Package net.datafaker.providers.base
Class Compass
- Since:
- 1.7.0
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class net.datafaker.providers.base.AbstractProvider
faker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns abbreviation of direction according to the specifiedCompass.CompassPointpoint of direction.azimuth()Returns appropriate azimuth of direction according to the specifiedCompass.CompassPointpoint of direction.compassPoint(Compass.CompassPoint compassPoint) Specify point of direction.word()Returns full-size name of direction according to the specifiedCompass.CompassPointpoint of direction.Methods inherited from class net.datafaker.providers.base.AbstractProvider
equals, getFaker, hashCode, loadGenerators, resolve, resolve, toString
-
Constructor Details
-
Compass
-
-
Method Details
-
compassPoint
Specify point of direction. If not specified, point of direction will be randomly selected.- Parameters:
compassPoint- point of direction.- Returns:
- itself with specified point of direction.
- See Also:
-
word
Returns full-size name of direction according to the specifiedCompass.CompassPointpoint of direction.Specify point of direction using
compassPoint(CompassPoint)method.Typical call of this method:
compass().compassPoint(CompassPoint.CARDINAL).word();- Returns:
- the full-size direction word according to the specified
Compass.CompassPoint. Otherwise, the point of direction will be selected randomly.
-
abbreviation
Returns abbreviation of direction according to the specifiedCompass.CompassPointpoint of direction.Specify point of direction using
compassPoint(CompassPoint)method.Typical call of this method:
compass().compassPoint(CompassPoint.CARDINAL).abbreviation();- Returns:
- the abbreviation of direction according to the specified
Compass.CompassPoint. Otherwise, the point of direction will be selected randomly.
-
azimuth
Returns appropriate azimuth of direction according to the specifiedCompass.CompassPointpoint of direction.Specify point of direction using
compassPoint(CompassPoint)method.Typical call of this method:
compass().compassPoint(CompassPoint.CARDINAL).azimuth();- Returns:
- the appropriate azimuth of the direction according to the specified
Compass.CompassPoint. Otherwise, the point of direction will be selected randomly.
-