public abstract class BasePropertyContainer
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KEY_PROPERTY |
protected java.util.HashMap<java.lang.String,java.lang.Object> |
properties |
Constructor and Description |
---|
BasePropertyContainer() |
Modifier and Type | Method and Description |
---|---|
void |
addProperty(java.lang.String propKey,
java.lang.Object propValue) |
java.lang.String |
getKey() |
java.util.HashMap<java.lang.String,java.lang.Object> |
getProperties() |
java.lang.Object |
getProperty(java.lang.String property) |
<T> T |
getProperty(java.lang.String property,
T defaultValue)
This is a type-safe and null-safe method to extract a property from a BPC.
|
boolean |
isEmpty() |
boolean |
isValid() |
void |
setKey(java.lang.String key) |
void |
setProperties(java.util.HashMap<java.lang.String,java.lang.Object> properties) |
java.lang.String |
toString()
this toString() is pretty expensive!
|
public static final java.lang.String KEY_PROPERTY
protected java.util.HashMap<java.lang.String,java.lang.Object> properties
public void setKey(java.lang.String key)
key
- the key to setpublic java.lang.String getKey()
public boolean isValid()
public boolean isEmpty()
public void setProperties(java.util.HashMap<java.lang.String,java.lang.Object> properties)
properties
- the properties to setpublic void addProperty(java.lang.String propKey, java.lang.Object propValue)
public java.util.HashMap<java.lang.String,java.lang.Object> getProperties()
public java.lang.Object getProperty(java.lang.String property)
public <T> T getProperty(java.lang.String property, T defaultValue)
T
- inferred at compile-time from the type of defaultValueproperty
- - name of the property to be returneddefaultValue
- - a default value to be returned when the property is invalidpublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
Copyright 2003, 2014, Oracle and/or its affiliates. All rights reserved.