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.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()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Direction
of(Language target)
A factory method to create direction object using only target language.static Direction
of(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 Language
target()
Get target/destination language.java.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
-