@NotThreadSafe public abstract class AbstractReadonlyAttributeContainer extends Object implements IReadonlyAttributeContainer
| Constructor and Description |
|---|
AbstractReadonlyAttributeContainer() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getAsBoolean(String sParamName,
Object aValue,
boolean bDefault) |
static double |
getAsDouble(String sParamName,
Object aValue,
double dDefault) |
static int |
getAsInt(String sParamName,
Object aValue,
int nDefault) |
static long |
getAsLong(String sParamName,
Object aValue,
long nDefault) |
static String |
getAsString(String sParamName,
Object aValue,
String sDefault)
Get the string representation of the passed value, suitable for parameters.
|
boolean |
getAttributeAsBoolean(String sName)
Get the attribute value associated to the given attribute name.
|
boolean |
getAttributeAsBoolean(String sName,
boolean bDefault)
Get the attribute value associated to the given attribute name.
|
double |
getAttributeAsDouble(String sName)
Get the attribute value associated to the given attribute name.
|
double |
getAttributeAsDouble(String sName,
double dDefault)
Get the attribute value associated to the given attribute name.
|
int |
getAttributeAsInt(String sName)
Get the attribute value associated to the given attribute name.
|
int |
getAttributeAsInt(String sName,
int nDefault)
Get the attribute value associated to the given attribute name.
|
long |
getAttributeAsLong(String sName)
Get the attribute value associated to the given attribute name.
|
long |
getAttributeAsLong(String sName,
long nDefault)
Get the attribute value associated to the given attribute name.
|
String |
getAttributeAsString(String sName)
Get the attribute value associated to the given attribute name.
|
String |
getAttributeAsString(String sName,
String sDefault)
Get the attribute value associated to the given attribute name or the
passed default value if no such attribute is present.
|
<DATATYPE> DATATYPE |
getCastedAttribute(String sName)
Get the attribute value associated to the given attribute name.
|
<DATATYPE> DATATYPE |
getCastedAttribute(String sName,
DATATYPE aDefault)
Get the attribute value associated to the given attribute name.
|
<DATATYPE> DATATYPE |
getTypedAttribute(String sName,
Class<DATATYPE> aDstClass)
Get the attribute value associated to the given attribute name.
|
<DATATYPE> DATATYPE |
getTypedAttribute(String sName,
Class<DATATYPE> aDstClass,
DATATYPE aDefault)
Get the attribute value associated to the given attribute name.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsAttribute, containsNoAttribute, getAllAttributeNames, getAllAttributes, getAllAttributeValues, getAttributeCount, getAttributeNames, getAttributeObject@Nullable public final <DATATYPE> DATATYPE getCastedAttribute(@Nullable String sName)
IReadonlyAttributeContainerClassCastException is thrown! If you just want to
retrieve a String, use IReadonlyAttributeContainer.getAttributeAsString(String)!getCastedAttribute(sName, null)getCastedAttribute in interface IReadonlyAttributeContainerDATATYPE - return typesName - the attribute namenull if no such value exists@Nullable public final <DATATYPE> DATATYPE getCastedAttribute(@Nullable String sName, @Nullable DATATYPE aDefault)
IReadonlyAttributeContainerClassCastException is thrown! If you just want to
retrieve a String, use IReadonlyAttributeContainer.getAttributeAsString(String, String)!getCastedAttribute in interface IReadonlyAttributeContainerDATATYPE - return typesName - The attribute name.aDefault - The default value to be returned if no such attribute exists@Nullable public final <DATATYPE> DATATYPE getTypedAttribute(@Nullable String sName, @Nonnull Class<DATATYPE> aDstClass)
IReadonlyAttributeContainerIReadonlyAttributeContainer.getAttributeAsString(String)!getTypedAttribute(sName, null)getTypedAttribute in interface IReadonlyAttributeContainerDATATYPE - return typesName - the attribute nameaDstClass - The destination class to convert to. May not be null.null if no such value exists@Nullable public final <DATATYPE> DATATYPE getTypedAttribute(@Nullable String sName, @Nonnull Class<DATATYPE> aDstClass, @Nullable DATATYPE aDefault)
IReadonlyAttributeContainerIReadonlyAttributeContainer.getAttributeAsString(String, String)!getTypedAttribute in interface IReadonlyAttributeContainerDATATYPE - return typesName - The attribute name.aDstClass - The destination class to convert to. May not be null.aDefault - The default value to be returned if no such attribute exists@Nullable public final String getAttributeAsString(@Nullable String sName)
IReadonlyAttributeContainergetAttributeAsString (sName, null)getAttributeAsString in interface IReadonlyAttributeContainersName - the attribute namenull if no such attribute
exists@Nullable public static String getAsString(@Nullable String sParamName, @Nullable Object aValue, @Nullable String sDefault)
sParamName - The name of the parameters. Has just informal character, for
warnings. May be null.aValue - The value to be converted to a String. May be null.
Explicitly supported data types are: String, String[]. All other
data types are returned as "toString()".sDefault - The default value to be returned, if the passed value is
null or an empty String array.null or an empty
String array, the value as string otherwise. If the value is a
String[] than the first element is returned, and the other elements
are discarded.@Nullable public final String getAttributeAsString(@Nullable String sName, @Nullable String sDefault)
IReadonlyAttributeContainergetAttributeAsString in interface IReadonlyAttributeContainersName - the attribute namesDefault - The default value to be returned, if the passed attribute name is
unknownsDefault if no such attribute
existspublic static int getAsInt(@Nullable String sParamName, @Nullable Object aValue, int nDefault)
public final int getAttributeAsInt(@Nullable String sName)
IReadonlyAttributeContainergetAttributeAsInt in interface IReadonlyAttributeContainersName - the attribute nameCGlobal.ILLEGAL_UINT if no such attribute
existspublic final int getAttributeAsInt(@Nullable String sName, int nDefault)
IReadonlyAttributeContainergetAttributeAsInt in interface IReadonlyAttributeContainersName - the attribute namenDefault - the default value to be returned if the value is not presentnDefault if no such attribute
existspublic static long getAsLong(@Nullable String sParamName, @Nullable Object aValue, long nDefault)
public final long getAttributeAsLong(@Nullable String sName)
IReadonlyAttributeContainergetAttributeAsLong in interface IReadonlyAttributeContainersName - the attribute nameCGlobal.ILLEGAL_ULONG if no such
attribute existspublic final long getAttributeAsLong(@Nullable String sName, long nDefault)
IReadonlyAttributeContainergetAttributeAsLong in interface IReadonlyAttributeContainersName - the attribute namenDefault - the default value to be returned if the value is not presentnDefault if no such attribute
existspublic static double getAsDouble(@Nullable String sParamName, @Nullable Object aValue, double dDefault)
public final double getAttributeAsDouble(@Nullable String sName)
IReadonlyAttributeContainergetAttributeAsDouble in interface IReadonlyAttributeContainersName - the attribute nameCGlobal.ILLEGAL_UINT if no such attribute
existspublic final double getAttributeAsDouble(@Nullable String sName, double dDefault)
IReadonlyAttributeContainergetAttributeAsDouble in interface IReadonlyAttributeContainersName - the attribute namedDefault - the default value to be returned if the value is not presentnDefault if no such attribute
existspublic static boolean getAsBoolean(@Nullable String sParamName, @Nullable Object aValue, boolean bDefault)
public final boolean getAttributeAsBoolean(@Nullable String sName)
IReadonlyAttributeContainergetAttributeAsBoolean in interface IReadonlyAttributeContainersName - the attribute namefalse if no such attribute
existspublic final boolean getAttributeAsBoolean(@Nullable String sName, boolean bDefault)
IReadonlyAttributeContainergetAttributeAsBoolean in interface IReadonlyAttributeContainersName - the attribute namebDefault - the default value to be returned if the value is not presentbDefault if no such attribute
existsCopyright © 2006–2015 phloc systems. All rights reserved.