Enum Class MappingCardinality
- All Implemented Interfaces:
Serializable
,Comparable<MappingCardinality>
,Constable
Represents the cardinality of a mapping. This indicates whether a mapping is
between exactly one subject and one object, between one subject and several
objects, etc.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic MappingCardinality
fromString
(String v) Parses a string into a mapping cardinality enum value.Gets the inverse of this cardinality (i.e., "1:n" -> "n:1").static String
Deprecated.static String
getSubject
(Mapping mapping) Deprecated.UseCardinalizer.getSubject(Mapping)
instead.static void
inferCardinality
(List<Mapping> mappings) Deprecated.UseCardinalizer.fillCardinality(List)
instead.toString()
static MappingCardinality
Returns the enum constant of this class with the specified name.static MappingCardinality[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ONE_TO_ONE
-
ONE_TO_MANY
-
MANY_TO_ONE
-
ONE_TO_NONE
-
NONE_TO_ONE
-
MANY_TO_MANY
-
NONE_TO_NONE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
toString
- Overrides:
toString
in classEnum<MappingCardinality>
-
getInverse
Gets the inverse of this cardinality (i.e., "1:n" -> "n:1").- Returns:
- The inverse cardinality (may be identical, e.g. for "1:1").
-
fromString
Parses a string into a mapping cardinality enum value.- Parameters:
v
- The string to parse.- Returns:
- The corresponding enumeration value, of
null
if the provided string does not match any mapping cardinality.
-
inferCardinality
Deprecated.UseCardinalizer.fillCardinality(List)
instead.Infers the cardinality for all mappings in the given list. This overrides any cardinality information that may already be stored in each mapping.- Parameters:
mappings
- The mappings for which to infer cardinality.
-
getSubject
Deprecated.UseCardinalizer.getSubject(Mapping)
instead.Gets a string representing the subject that can be used for cardinality computation. The returned value takes into account the subject_id (or the subject_label if the subject is a literal) and the subject_type.- Parameters:
mapping
- The mapping from which to derive a subject string.- Returns:
- A string that can be used to compare subjects across mappings.
-
getObject
Deprecated.UseCardinalizer.getObject(Mapping)
instead.Gets a string representing the object that can be used for cardinality computation. The returned value takes into account the object_id (or the object_label if the object is a literal) and the object_type.- Parameters:
mapping
- The mapping from which to derive an object string.- Returns:
- A String that can be used to compare objects across mappings.
-
Cardinalizer.getObject(Mapping)
instead.