[Java] Class PluginDefaultGroovyMethods
- org.codehaus.groovy.vmplugin.v5.PluginDefaultGroovyMethods
@Deprecated public class PluginDefaultGroovyMethods extends DefaultGroovyMethodsSupport
This class defines new Java 5 specific groovy methods which extend the normal JDK classes inside the Groovy environment. Static methods are used with the first parameter the destination class.
Methods Summary
Type Params | Return Type | Name and description |
---|---|---|
public static StringBuilder |
leftShift(StringBuilder self, Object value) Overloads the left shift operator to provide an easy way to append multiple objects as string representations to a StringBuilder. | |
public static Object |
next(Enum self) This method is called by the ++ operator for enums. | |
public static String |
plus(StringBuilder self, String value) Appends a String to this StringBuilder. | |
public static Object |
previous(Enum self) This method is called by the -- operator for enums. | |
public static void |
putAt(StringBuilder self, IntRange range, Object value) Support the range subscript operator for StringBuilder. | |
public static void |
putAt(StringBuilder self, EmptyRange range, Object value) Support the range subscript operator for StringBuilder. | |
public static int |
size(StringBuilder builder) Standard Groovy size() method for StringBuilders. |
Inherited Methods Summary
Method Detail
public static StringBuilder leftShift(StringBuilder self, Object value)
Overloads the left shift operator to provide an easy way to append multiple objects as string representations to a StringBuilder.
- Parameters:
-
self
- a StringBuilder -
value
- a value to append
- Returns:
- the StringBuilder on which this operation was invoked
public static Object next(Enum self)
This method is called by the ++ operator for enums. It will invoke Groovy's default next behaviour for enums do not have their own next method.
- Parameters:
-
self
- an Enum
- Returns:
- the next defined enum from the enum class
public static String plus(StringBuilder self, String value)
Appends a String to this StringBuilder.
- Parameters:
-
self
- a StringBuilder -
value
- a String
- Returns:
- a String
public static Object previous(Enum self)
This method is called by the -- operator for enums. It will invoke Groovy's default previous behaviour for enums that do not have their own previous method.
- Parameters:
-
self
- an Enum
- Returns:
- the previous defined enum from the enum class
public static void putAt(StringBuilder self, IntRange range, Object value)
Support the range subscript operator for StringBuilder. Index values are treated as characters within the builder.
- Parameters:
-
self
- a StringBuilder -
range
- a Range -
value
- the object that's toString() will be inserted
public static void putAt(StringBuilder self, EmptyRange range, Object value)
Support the range subscript operator for StringBuilder.
- Parameters:
-
self
- a StringBuilder -
range
- a Range -
value
- the object that's toString() will be inserted
public static int size(StringBuilder builder)
Standard Groovy size() method for StringBuilders.
- Parameters:
-
builder
- a StringBuilder
- Returns:
- the length of the StringBuilder
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/org/codehaus/groovy/vmplugin/v5/PluginDefaultGroovyMethods.html