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
AbstractIdentifiedObject
and we don't want to duplicate them inNamedIdentifier
. - Optionally rename de
NAME_KEY
asCODE_KEY
in order to allowNamedIdentifier
to inherit the name given toAbstractIdentifiedObject
if no code were explicitly given.
- Since:
- 0.4
- Version:
- 0.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PropertiesConverter
The converter to use if the map already contains aCODE_KEY
.private static final PropertiesConverter
The converter to use if the does not contain aCODE_KEY
, in which case it needs to be inferred from theNAME_KEY
.private final boolean
true
for renamingNAME_KEY
asCODE_KEY
, orfalse
for excluding theNAME_KEY
instead. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
PropertiesConverter
(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 renametrue
for renamingNAME_KEY
asCODE_KEY
, orfalse
for excluding theNAME_KEY
instead.
-
-
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
.
-