public abstract class ProfileDefinition<P extends CommonProfile> extends Object
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
protected Function<Object[],P> |
newProfile |
Constructor and Description |
---|
ProfileDefinition() |
Modifier and Type | Method and Description |
---|---|
void |
convertAndAdd(CommonProfile profile,
Map<String,Object> attributes)
Convert the attributes if necessary and add them to the profile.
|
void |
convertAndAdd(CommonProfile profile,
String name,
Object value)
Convert the attribute if necessary and add it to the profile.
|
protected Map<String,AttributeConverter<? extends Object>> |
getConverters() |
List<String> |
getPrimaryAttributes() |
List<String> |
getSecondaryAttributes() |
P |
newProfile(Object... parameters)
Return the new built profile.
|
protected void |
primary(String name,
AttributeConverter<? extends Object> converter)
Add an attribute as a primary one and its converter.
|
protected void |
secondary(String name,
AttributeConverter<? extends Object> converter)
Add an attribute as a secondary one and its converter.
|
protected void |
setProfileFactory(Function<Object[],P> profileFactory)
Define the way to build the profile.
|
protected final org.slf4j.Logger logger
protected Function<Object[],P extends CommonProfile> newProfile
public P newProfile(Object... parameters)
parameters
- some optional input parameterspublic void convertAndAdd(CommonProfile profile, String name, Object value)
profile
- the profilename
- the attribute namevalue
- the attribute valuepublic void convertAndAdd(CommonProfile profile, Map<String,Object> attributes)
profile
- the profileattributes
- the attributesprotected void setProfileFactory(Function<Object[],P> profileFactory)
profileFactory
- the way to build the profileprotected void primary(String name, AttributeConverter<? extends Object> converter)
name
- name of the attributeconverter
- converterprotected void secondary(String name, AttributeConverter<? extends Object> converter)
name
- name of the attributeconverter
- converterprotected Map<String,AttributeConverter<? extends Object>> getConverters()
Copyright © 2017. All rights reserved.