Package com.cloudinary.transformation
Class BaseExpression<T extends BaseExpression>
java.lang.Object
com.cloudinary.transformation.BaseExpression<T>
- Type Parameters:
T- Children must define themselves as T
- Direct Known Subclasses:
Condition,Expression
public abstract class BaseExpression<T extends BaseExpression>
extends java.lang.Object
Defines an expression used in transformation parameter values
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.lang.String>expressionsstatic java.util.Map<java.lang.String,java.lang.String>OPERATORSprotected Transformationparentstatic java.util.Map<java.lang.String,java.lang.String>PREDEFINED_VARS -
Constructor Summary
Constructors Modifier Constructor Description protectedBaseExpression() -
Method Summary
Modifier and Type Method Description Tadd()Tadd(java.lang.Object value)Tand()Tand(java.lang.Object value)Tclone()Tdiv()Tdiv(java.lang.Object value)Teq()Teq(java.lang.Object value)TransformationgetParent()Tgt()Tgt(java.lang.Object value)Tgte()Tgte(java.lang.Object value)Tlt()Tlt(java.lang.Object value)Tlte()Tlte(java.lang.Object value)Tmultiple(java.lang.Object value)Tne()Tne(java.lang.Object value)protected abstract TnewInstance()static java.lang.Stringnormalize(java.lang.Object expression)Normalize an expression string, replace "nice names" with their coded values and spaces with "_".Tor()Tor(java.lang.Object value)Tpow()Adds "to the power of" sub-expression to the end of the list of already present sub-expressions in this expression instance.Tpow(java.lang.Object value)Utility shortcut method which invokes on this Expression instancepow()method, takes its result and invokesvalue(Object)method on it.java.lang.Stringserialize()TsetParent(Transformation parent)Tsub()Tsub(java.lang.Object value)java.lang.StringtoString()Tvalue(java.lang.Object value)
-
Field Details
-
OPERATORS
public static final java.util.Map<java.lang.String,java.lang.String> OPERATORS -
PREDEFINED_VARS
public static final java.util.Map<java.lang.String,java.lang.String> PREDEFINED_VARS -
expressions
protected java.util.List<java.lang.String> expressions -
parent
-
-
Constructor Details
-
BaseExpression
protected BaseExpression()
-
-
Method Details
-
normalize
public static java.lang.String normalize(java.lang.Object expression)Normalize an expression string, replace "nice names" with their coded values and spaces with "_".- Parameters:
expression- an expression- Returns:
- a parsed expression
-
getParent
-
setParent
-
serialize
public java.lang.String serialize() -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
clone
- Overrides:
clonein classjava.lang.Object
-
multiple
-
newInstance
-
gt
-
gt
-
and
-
and
-
or
-
or
-
eq
-
eq
-
ne
-
ne
-
lt
-
lt
-
lte
-
lte
-
gte
-
gte
-
div
-
div
-
add
-
add
-
sub
-
sub
-
pow
Utility shortcut method which invokes on this Expression instancepow()method, takes its result and invokesvalue(Object)method on it. Effectively, invocation of this shortcut results in "to the power of value" sub-expression added to the end of current expression instance.- Parameters:
value- argument forvalue(Object)call- Returns:
- result of
value(Object)call
-
pow
Adds "to the power of" sub-expression to the end of the list of already present sub-expressions in this expression instance.- Returns:
- this expression instance
-
value
-