public abstract class RecordWrapper extends Object implements IRecordWrapper
Constructor and Description |
---|
RecordWrapper()
Creates a new record wrapper instance.
|
RecordWrapper(HolderFactory factory)
Creates a new record wrapper along with the underlying record.
|
RecordWrapper(RecordHolder holder)
Creates a new record wrapper instance.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
asMap()
Returns a map view of this record.
|
void |
create(HolderFactory factory)
Creates an underlying record holder.
|
boolean |
equals(Object obj) |
protected int |
getIntProperty(String property) |
Object |
getProperty(String name)
Returns the property value.
|
abstract String |
getTypeName()
Returns the full type name of the record.
|
int |
hashCode() |
RecordHolder |
holder()
Returns the record holder.
|
boolean |
isCreated()
Returns
true if the underlying record is created. |
protected void |
setIntProperty(String property,
int val) |
void |
setProperty(String name,
Object value)
Sets the property value.
|
protected <E> Collection<E> |
toCollection(CollectionHolder collection,
Class<E> clazz,
RecordWrapperFactory factory)
Converts a given collection of LSPS records to record wrappers using a given factory.
|
protected <E> List<E> |
toList(ListHolder list,
Class<E> clazz,
RecordWrapperFactory factory)
Converts a given list of LSPS records to record wrappers using a given factory.
|
protected <E> Set<E> |
toSet(SetHolder set,
Class<E> clazz,
RecordWrapperFactory factory)
Converts a given set of LSPS records to record wrappers using a given factory.
|
String |
toString()
Returns a string representation of the wrapped holder.
|
static List<RecordHolder> |
unwrap(Collection<? extends IRecordWrapper> collection)
Unwraps a given collection of record wrappers.
|
public RecordWrapper()
public RecordWrapper(RecordHolder holder)
holder
- public RecordWrapper(HolderFactory factory)
factory
- public abstract String getTypeName()
IRecordWrapper
getTypeName
in interface IRecordWrapper
public final RecordHolder holder()
IRecordWrapper
holder
in interface IRecordWrapper
public final boolean isCreated()
true
if the underlying record is created.true
if the underlying record is createdpublic final Object getProperty(String name)
name
- a property namepublic final void setProperty(String name, Object value)
name
- a property namevalue
- a new property valuepublic final void create(HolderFactory factory)
IllegalStateException
is thrown.factory
- public final Map<String,Object> asMap()
public String toString()
protected <E> Set<E> toSet(SetHolder set, Class<E> clazz, RecordWrapperFactory factory)
E
- set
- clazz
- factory
- protected <E> List<E> toList(ListHolder list, Class<E> clazz, RecordWrapperFactory factory)
E
- list
- clazz
- factory
- protected <E> Collection<E> toCollection(CollectionHolder collection, Class<E> clazz, RecordWrapperFactory factory)
E
- collection
- clazz
- factory
- public static List<RecordHolder> unwrap(Collection<? extends IRecordWrapper> collection)
collection
- protected int getIntProperty(String property)
protected void setIntProperty(String property, int val)
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.