Package io.sundr.model
Class ValueRef
java.lang.Object
io.sundr.model.ValueRef
- All Implemented Interfaces:
Expression,Node,Renderable,WithReferences
-
Field Summary
FieldsFields inherited from interface io.sundr.model.Node
AT, CB, CC, CLP, COLN, COMA, CP, DOT, DQ, EMPTY, EQ, EXTENDS, GT, IMPLEMENTS, INDENT, JAVA_LANG, JAVA_LANG_ENUM, JAVA_LANG_OBJECT, JAVA_LANG_STRING, LT, NEWLINE, NEWLINE_PATTERN, OB, OC, OP, Q, SEMICOLN, SEMICOLN_SUFFIX_PATTERN, SPACE, STAR, THROWS, VARARG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ValueReffrom(T[] value) static <T> ValueReffrom(T value, T... rest) getValue()render()Render the type into aStringfor the purpose of code generation.static ExpressiontoExpression(Object value) Converts a value to anExpression, wrapping literals in aValueRef.static Expression[]toExpressions(Object... values) Converts an array of values to expressions, wrapping literals in aValueRef.static StringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.sundr.model.Expression
and, and, assign, assign, assignNew, assignNew, assignNull, call, call, call, cast, cast, cast, divide, enclosed, eq, index, index, instanceOf, instanceOf, isNull, minus, minus, modulo, multiply, ne, negative, not, notNull, or, or, plus, plus, positive, postDecrement, postIncrement, preIncrement, pretDecrement, property, property, property, renderExpression, retMethods inherited from interface io.sundr.model.Renderable
tabMethods inherited from interface io.sundr.model.WithReferences
getReferences
-
Field Details
-
NULL
-
-
Constructor Details
-
ValueRef
-
-
Method Details
-
from
-
from
-
toExpression
Converts a value to anExpression, wrapping literals in aValueRef. Values that are already expressions are returned as is.- Parameters:
value- the value to convert, may be a literal or an expression- Returns:
- the value as an expression
-
toExpressions
Converts an array of values to expressions, wrapping literals in aValueRef.- Parameters:
values- the values to convert, each may be a literal or an expression- Returns:
- the values as expressions
-
getValue
-
toString
-
render
Description copied from interface:RenderableRender the type into aStringfor the purpose of code generation. This is slightly different from the `toString()` method as `toString()` is mostly needed for logging / debugging and should be idempotent. Regarding idempotency this method may yield different result based on the context it is used even if the internal state of the object does not change. An example of such case, is a reference to class that may change based on the package from which it's refenced.- Specified by:
renderin interfaceRenderable- Returns:
- the
Stringrepresentation of the object as it's meant to appear in the generated code.
-