Class Direction

  • All Implemented Interfaces:
    java.io.Serializable

    @Immutable
    public abstract class Direction
    extends java.lang.Object
    implements java.io.Serializable
    Model which represents direction of translation.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SEPARATOR  
    • Constructor Summary

      Constructors 
      Constructor Description
      Direction()  
    • Constructor Detail

      • Direction

        public Direction()
    • Method Detail

      • source

        @Nonnull
        @Parameter(order=0)
        public abstract java.util.Optional<Language> source()
        Get source/origin language.
        Returns:
        source language
      • target

        @Nonnull
        @Parameter(order=1)
        public abstract Language target()
        Get target/destination language.
        Returns:
        target language
      • of

        @Nonnull
        public static Direction of​(@Nullable
                                   Language source,
                                   @Nonnull
                                   Language target)
        A factory method to create direction object using source and target languages.
        Parameters:
        source - source language
        target - target language
        Returns:
        direction (from source to target)
      • of

        @Nonnull
        public static Direction of​(@Nonnull
                                   Language target)
        A factory method to create direction object using only target language. Source language will be null/empty (and will be detected automatically during translation).
        Parameters:
        target - target language
        Returns:
        direction (from something to target)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object