Class ModelPath


  • public class ModelPath
    extends Object
    An abstraction for a path of model classes.
    Author:
    Carl Harris
    • Method Detail

      • with

        public static ModelPath with​(List<Class<?>> path)
        Creates a new path object with the given sequence of model types.
        Parameters:
        path - sequence of model types
        Returns:
        model path
      • with

        public static ModelPath with​(Class<?>... path)
        Creates a new path object with the given sequence of model types.
        Parameters:
        path - sequence of model types
        Returns:
        model path
      • concat

        public ModelPath concat​(List<Class<?>> path)
        Creates a new model path from this path concatenated with the given sequence of model types.
        Parameters:
        path - sequence of model types to concatenate with this path
        Returns:
        model path
      • concat

        public ModelPath concat​(Class<?>... path)
        Creates a new model path from this path concatenated with the given sequence of model types.
        Parameters:
        path - sequence of model types to concatenate with this path
        Returns:
        model path
      • concat

        public ModelPath concat​(ModelPathSpec modelPathSpec)
        Creates a new model path from this path concatenated with the sequence of model types on the given ModelPathSpec annotation. sequence of model types.
        Parameters:
        modelPathSpec - a referenced by annotation (which may be null)
        Returns:
        model path
      • asList

        public List<Class<?>> asList()
        Gets the sequence of model types in this path as a list.
        Returns:
        list of model types
      • asArray

        public Class<?>[] asArray()
        Gets the sequence of model types in this path as an array
        Returns:
        array of model types
      • matchTypeAt

        public ModelPath.MatchType matchTypeAt​(int index)
        Gets the match type of the path element at the given index.
        Parameters:
        index - index of the subject path element
        Returns:
        match type
      • length

        public int length()
        Gets the length of this path.
        Returns:
        path length
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object