public final class Coordinates
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
checkClassesRelations(java.lang.Iterable<java.lang.Class<?>> coordinates)
Validates dependence between given classes (interfaces) such that two interfaces in the same inheritance line are
not given.
|
static void |
checkClassRelations(java.lang.Class<?> classToCheck,
java.lang.Iterable<java.lang.Class<?>> dimensions)
Validates dependence between given class (interface) such that ANY o the given coordinates is assignable from it.
|
static java.lang.String |
dimensionsWithoutClassPath(Position position)
Provides the way to reduce long classpath names of the coordinates classes to only short Class names.
|
static java.lang.String |
dimensionsWithoutClassPath(java.util.Set<java.lang.Class<?>> dimensionSet)
Provides the way to reduce long classpath names of the coordinates classes to only short Class names.
|
static java.lang.String |
dimensionsWithoutClassPath(Tensor<?> tensor)
Provides the way to reduce long classpath names of the coordinates classes to only short Class names.
|
static <C> C |
firstCoordinateOfTyp(java.util.Set<?> coordinates,
java.lang.Class<C> dimension)
Extracts from a set of coordinates, the coordinate which corresponds to the given dimension.
|
static java.util.Set<java.lang.Class<?>> |
getDimensionsFrom(java.util.Set<?> coordinates)
Utility method that extract the final classes of the given coordinates instances.
|
static void |
initialCheckForClassRelations(java.lang.Class<?> classToCheck,
java.lang.Iterable<java.lang.Class<?>> coordinates)
Validates dependence between given class (interface) such that NONE of the classes can be assignable from it.
|
static <C> com.google.common.collect.ClassToInstanceMap<C> |
mapOf(java.lang.Iterable<? extends C> coordinates)
Deprecated.
|
static <C> java.lang.Class<? super C> |
mapToAnEntry(java.lang.Class<C> classToCheck,
java.lang.Iterable<java.lang.Class<?>> dimensions) |
static java.util.Set<java.lang.Class<?>> |
parentClassDifference(java.util.Set<java.lang.Class<?>> originalDimensions,
java.util.Set<? extends java.lang.Class<?>> dimensionsToStrip)
Returns the difference of two sets of coordinates, by removing the dimensionToStrip set from the
originalDimensions.
|
static java.util.Set<java.lang.Class<?>> |
parentClassIntersection(java.util.Set<java.lang.Class<?>> left,
java.util.Set<java.lang.Class<?>> right)
Finds the intersection of the two dimension sets, taking correctly into account the class hierarchy of the set
dimensions.
|
static java.util.Set<?> |
requireValidCoordinates(java.lang.Iterable<?> coordinates) |
static java.util.Set<java.lang.Class<?>> |
requireValidDimensions(com.google.common.collect.Multiset<java.lang.Class<?>> dimensions) |
@Deprecated public static <C> com.google.common.collect.ClassToInstanceMap<C> mapOf(java.lang.Iterable<? extends C> coordinates)
IllegalArgumentException
.coordinates
- the coordinates to be added to the mapjava.lang.IllegalArgumentException
- if more than one coordinate per dimension are providedpublic static void checkClassesRelations(java.lang.Iterable<java.lang.Class<?>> coordinates)
coordinates
- java.lang.IllegalArgumentException
- when any of the given classes are linked by the inheritance line.public static void initialCheckForClassRelations(java.lang.Class<?> classToCheck, java.lang.Iterable<java.lang.Class<?>> coordinates)
classToCheck
- a class to verifycoordinates
- available coordinates classesjava.lang.IllegalArgumentException
- when any of the given classes are linked by the inheritance line.public static void checkClassRelations(java.lang.Class<?> classToCheck, java.lang.Iterable<java.lang.Class<?>> dimensions)
classToCheck
- a class to verifydimensions
- available coordinates classesjava.lang.IllegalArgumentException
- when any of the given classes are linked by the inheritance line.public static <C> java.lang.Class<? super C> mapToAnEntry(java.lang.Class<C> classToCheck, java.lang.Iterable<java.lang.Class<?>> dimensions)
public static java.util.Set<java.lang.Class<?>> parentClassIntersection(java.util.Set<java.lang.Class<?>> left, java.util.Set<java.lang.Class<?>> right)
example: If class A inherits from class B and one set contains A and the other B, then B will be returned.
left
- one set of dimensionsright
- the other set of dimensionsjava.lang.IllegalArgumentException
- if a combination of elements of the two sets would result in duplicated entries
(e.g. the sets are not disjunct in hierarchy)public static java.lang.String dimensionsWithoutClassPath(Tensor<?> tensor)
tensor
- to extract the dimension set and reduce their length of the output stringpublic static java.lang.String dimensionsWithoutClassPath(Position position)
position
- to extract the dimension set and reduce their ength of the output stringpublic static java.lang.String dimensionsWithoutClassPath(java.util.Set<java.lang.Class<?>> dimensionSet)
dimensionSet
- to reduce length of the output stringpublic static java.util.Set<?> requireValidCoordinates(java.lang.Iterable<?> coordinates)
public static java.util.Set<java.lang.Class<?>> requireValidDimensions(com.google.common.collect.Multiset<java.lang.Class<?>> dimensions)
public static <C> C firstCoordinateOfTyp(java.util.Set<?> coordinates, java.lang.Class<C> dimension)
coordinates
- the set of coordinates from which to extract the coordinatedimension
- the dimension for which to find the coordinate.null
if none is contained
in the set.public static java.util.Set<java.lang.Class<?>> getDimensionsFrom(java.util.Set<?> coordinates)
coordinates
- to scanpublic static java.util.Set<java.lang.Class<?>> parentClassDifference(java.util.Set<java.lang.Class<?>> originalDimensions, java.util.Set<? extends java.lang.Class<?>> dimensionsToStrip)
originalDimensions
- the original set of dimensionsdimensionsToStrip
- the dimensions to remove