Package com.github.vbauer.yta.model
Class Direction
- java.lang.Object
-
- com.github.vbauer.yta.model.Direction
-
- All Implemented Interfaces:
java.io.Serializable
@Immutable public abstract class Direction extends java.lang.Object implements java.io.SerializableModel which represents direction of translation.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSEPARATOR
-
Constructor Summary
Constructors Constructor Description Direction()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Directionof(Language target)A factory method to create direction object using only target language.static Directionof(Language source, Language target)A factory method to create direction object using source and target languages.abstract java.util.Optional<Language>source()Get source/origin language.abstract Languagetarget()Get target/destination language.java.lang.StringtoString()
-
-
-
Field Detail
-
SEPARATOR
public static final java.lang.String SEPARATOR
- See Also:
- Constant Field Values
-
-
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 languagetarget- 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:
toStringin classjava.lang.Object
-
-