Package com.spotify.github
Class GitHubInstant
- java.lang.Object
-
- com.spotify.github.GitHubInstant
-
public class GitHubInstant extends Object
Make sure we can represent a GitHub date, they are inconsistent at best. Sometimes the date is represented as a Long, sometimes represented as a String following:DateTimeFormatter.ISO_INSTANT
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GitHubInstant
create(Number inst)
Creates an instance of this class from a number.static GitHubInstant
create(Instant inst)
Creates an instance of this class from an instant.Long
epoch()
Returns the contained value as a unix epoch contained in a LongInstant
instant()
Rerturns the contained value as a unix epoch contained in an InstantClass<?>
type()
Returns the Class type of the contained value.
-
-
-
Method Detail
-
create
public static GitHubInstant create(@Nonnull Number inst)
Creates an instance of this class from a number.- Parameters:
inst
- a Number- Returns:
- GitHubDateWrapper
-
create
public static GitHubInstant create(@Nonnull Instant inst)
Creates an instance of this class from an instant.- Parameters:
inst
- an Instant- Returns:
- GitHubDateWrapper
-
type
public Class<?> type()
Returns the Class type of the contained value.- Returns:
- a Class.
-
epoch
public Long epoch()
Returns the contained value as a unix epoch contained in a Long- Returns:
- epoch in seconds
-
instant
public Instant instant()
Rerturns the contained value as a unix epoch contained in an Instant- Returns:
- an instant
-
-