Package org.apache.sis.referencing
Class PropertiesConverter
java.lang.Object
org.apache.sis.internal.converter.SurjectiveConverter<String,String>
org.apache.sis.referencing.PropertiesConverter
Converts
AbstractIdentifiedObject entries to NamedIdentifier entries.
This converter:
- Exclude remarks, because they will be taken by
AbstractIdentifiedObjectand we don't want to duplicate them inNamedIdentifier. - Optionally rename de
NAME_KEYasCODE_KEYin order to allowNamedIdentifierto inherit the name given toAbstractIdentifiedObjectif no code were explicitly given.
- Since:
- 0.4
- Version:
- 0.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PropertiesConverterThe converter to use if the map already contains aCODE_KEY.private static final PropertiesConverterThe converter to use if the does not contain aCODE_KEY, in which case it needs to be inferred from theNAME_KEY.private final booleantruefor renamingNAME_KEYasCODE_KEY, orfalsefor excluding theNAME_KEYinstead. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePropertiesConverter(boolean rename) Constructor for static constants only. -
Method Summary
Modifier and TypeMethodDescriptionConverts a key as documented in class javadoc.Converts the given map.Returns the type of keys before conversion.Returns the type of keys after conversion.Methods inherited from class org.apache.sis.internal.converter.SurjectiveConverter
inverse, properties, toString
-
Field Details
-
CODE_INCLUDED
The converter to use if the map already contains aCODE_KEY. -
CODE_INFERED
The converter to use if the does not contain aCODE_KEY, in which case it needs to be inferred from theNAME_KEY. -
rename
private final boolean renametruefor renamingNAME_KEYasCODE_KEY, orfalsefor excluding theNAME_KEYinstead.
-
-
Constructor Details
-
PropertiesConverter
private PropertiesConverter(boolean rename) Constructor for static constants only.
-
-
Method Details
-
convert
Converts the given map. -
getSourceClass
Returns the type of keys before conversion.- Returns:
- the type of objects to convert.
-
getTargetClass
Returns the type of keys after conversion.- Returns:
- the type of converted objects.
-
apply
Converts a key as documented in class javadoc.- Parameters:
key- the object to convert, ornull.- Returns:
- the converted object, or
null.
-