@PersistantProperties(properties=@PersistantProperty(property="decimals",defaultValue="0")) public class Round extends AbstractReadSourceAccessor
IReadAccessor.Standalone
Modifier and Type | Field and Description |
---|---|
static String |
ROUND_ID |
internalExpectedGenericType, internalExpectedType, source
Constructor and Description |
---|
Round() |
Round(IReadAccessor source) |
Round(Rounder decimals) |
Round(Rounder decimals,
IReadAccessor source) |
Modifier and Type | Method and Description |
---|---|
Round |
clone()
Clones the Addon.
|
<G,C extends Collection<G>> |
compileCollection(ICompilationContext ctxt,
Class<C> expectedType,
Class<G> expectedGenericType)
Implementation to handle case when expected result is a Collection.
|
void |
compileValue(ICompilationContext ctxt,
Class<?> expectedType)
Implementation to handle case when expected result is a single value.
|
boolean |
equals(Object o) |
protected BigDecimal |
format(BigDecimal ret)
Method used to format returned property (desired number of decimals, trailing zeros removed, etc ...)
|
Rounder |
getDecimals() |
String |
getImplementationId()
Unique addon implementation ID.
|
int |
hashCode() |
protected boolean |
parseCollections()
Always true.
|
void |
setDecimals(Rounder decimals) |
Object |
specificHandleValue(IExecutionContext ctxt,
Object value)
Override this to apply specific transformation on value read from source accessor.
|
void |
toString(OuterWithLevel outer)
Method used to send String representation of the current object to the
OuterWithLevel . |
getEstimatedReadCost, getGenericCollectionType, getInternalCacheIdentifier, getSource, getType, handleValue, internalGet, isCacheUsed, isConstantValue, isInternalCacheIdentifierNeeded, isShouldIterate, resetCachedData, setInternalCacheIdentifier, setSource, wasRegistered
castToExpected, compileRead, compileRead, compileRead, compileRead, get, getGenericTypes, isShouldBeWrappedToConstantValue, isShouldNotCache
optimize, toString
getDebugInfo, getDescription, getName, setDebugInfo, setDescription, setName
finalize, getClass, notify, notifyAll, wait, wait, wait
getDebugInfo, getDescription, getName, setDebugInfo, setDescription, setName
public static final String ROUND_ID
public Round()
public Round(IReadAccessor source)
public Round(Rounder decimals)
public Round(Rounder decimals, IReadAccessor source)
public void compileValue(ICompilationContext ctxt, Class<?> expectedType) throws MRuleValidationException
AbstractReadAccessor
compileValue
in class AbstractReadAccessor
MRuleValidationException
public <G,C extends Collection<G>> void compileCollection(ICompilationContext ctxt, Class<C> expectedType, Class<G> expectedGenericType) throws MRuleValidationException
AbstractReadAccessor
compileCollection
in class AbstractReadAccessor
MRuleValidationException
protected boolean parseCollections()
parseCollections
in class AbstractReadSourceAccessor
public Object specificHandleValue(IExecutionContext ctxt, Object value) throws MAccessorException
AbstractReadSourceAccessor
specificHandleValue
in class AbstractReadSourceAccessor
MAccessorException
protected final BigDecimal format(BigDecimal ret)
public String getImplementationId()
IAddon
public Round clone()
IAddon
clone
in interface IAccessor
clone
in interface IReadAccessor
clone
in interface IAddon
clone
in interface IMRulesObject
clone
in class AbstractReadSourceAccessor
public boolean equals(Object o)
equals
in class AbstractReadSourceAccessor
public int hashCode()
hashCode
in class AbstractReadSourceAccessor
public void toString(OuterWithLevel outer) throws IOException
Outable
OuterWithLevel
.toString
in interface Outable
toString
in class AbstractReadSourceAccessor
IOException
public Rounder getDecimals()
public void setDecimals(Rounder decimals)