Package com.storedobject.core
Interface ObjectToString<T extends StoredObject>
- Type Parameters:
T
- Object type.
- All Known Implementing Classes:
ObjectToString.O2S
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface ObjectToString<T extends StoredObject>
extends Function<T,String>
Interface to convert a
StoredObject
to String
.- Author:
- Syam
-
Nested Class Summary
Nested Classes -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <O extends StoredObject>
ObjectToString<O> create
(Class<O> objectClass, StringList attributes) Create anObjectToString
implementation for a given set of attributes.static <O extends StoredObject>
ObjectToString<O> create
(Class<O> objectClass, StringList attributes, boolean showAttributes) Create anObjectToString
implementation for a given set of attributes.static <O extends StoredObject>
ObjectToString<O> create
(Class<O> objectClass, StoredObjectUtility.MethodList displayMethod) Create anObjectToString
implementation for a given set of attributes.static <O extends StoredObject>
ObjectToString<O> Create anObjectToString
implementation for a given set of attributes.static <O extends StoredObject>
ObjectToString<O> create
(Class<O> objectClass, String delimiter, StringList attributes) Create anObjectToString
implementation for a given set of attributes.static <O extends StoredObject>
ObjectToString<O> create
(Class<O> objectClass, String delimiter, StringList attributes, boolean showAttributes) Create anObjectToString
implementation for a given set of attributes.
-
Method Details
-
create
static <O extends StoredObject> ObjectToString<O> create(Class<O> objectClass, String... attributes) Create anObjectToString
implementation for a given set of attributes.- Type Parameters:
O
- Type of the object.- Parameters:
objectClass
- Object class to convert.attributes
- Attributes of the object to convert.- Returns:
- Interface implementation.
-
create
static <O extends StoredObject> ObjectToString<O> create(Class<O> objectClass, StringList attributes) Create anObjectToString
implementation for a given set of attributes.- Type Parameters:
O
- Type of the object.- Parameters:
objectClass
- Object class to convert.attributes
- Attributes of the object to convert.- Returns:
- Interface implementation.
-
create
static <O extends StoredObject> ObjectToString<O> create(Class<O> objectClass, String delimiter, StringList attributes) Create anObjectToString
implementation for a given set of attributes.- Type Parameters:
O
- Type of the object.- Parameters:
objectClass
- Object class to convert.delimiter
- Delimiter to separate the result of the attribute values.attributes
- Attributes of the object to convert.- Returns:
- Interface implementation.
-
create
static <O extends StoredObject> ObjectToString<O> create(Class<O> objectClass, StringList attributes, boolean showAttributes) Create anObjectToString
implementation for a given set of attributes.- Type Parameters:
O
- Type of the object.- Parameters:
objectClass
- Object class to convert.attributes
- Attributes of the object to convert.- Returns:
- Interface implementation.
-
create
static <O extends StoredObject> ObjectToString<O> create(Class<O> objectClass, String delimiter, StringList attributes, boolean showAttributes) Create anObjectToString
implementation for a given set of attributes.- Type Parameters:
O
- Type of the object.- Parameters:
objectClass
- Object class to convert.delimiter
- Delimiter to separate the result of the attribute values.attributes
- Attributes of the object to convert.showAttributes
- Whether to show the name of the attribute or not.- Returns:
- Interface implementation.
-
create
static <O extends StoredObject> ObjectToString<O> create(Class<O> objectClass, StoredObjectUtility.MethodList displayMethod) Create anObjectToString
implementation for a given set of attributes.- Type Parameters:
O
- Type of the object.- Parameters:
objectClass
- Object class to convert.displayMethod
- Method to use for conversion.- Returns:
- Interface implementation.
-