Package com.draftable.api.client
Class Comparison
java.lang.Object
com.draftable.api.client.Comparison
Represents a comparison that has been created.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Represents a file passed as the left or right side of a comparison. -
Constructor Summary
ConstructorsConstructorDescriptionComparison
(String identifier, Comparison.Side left, Comparison.Side right, boolean isPublic, Instant creationTime, Instant expiryTime, boolean ready, Instant readyTime, Boolean failed, String errorMessage) Creates a representation of a comparison that has been created. -
Method Summary
Modifier and TypeMethodDescriptionfinal Instant
Gets when the comparison was created.final String
If the comparison failed, gets an message describing error.final Instant
Gets when the comparison expires, or null if it doesn't expire.final Boolean
Gets whether the comparison failed.final String
Gets the comparison's identifier.final boolean
Gets whether the comparison is public or private.final Comparison.Side
getLeft()
Gets metadata for the left file.final boolean
getReady()
Gets whether the comparison has been processed.final Instant
If the comparison is ready, gives the time at which processing finished.final Comparison.Side
getRight()
Gets metadata for the right file.final String
toString()
-
Constructor Details
-
Comparison
public Comparison(@Nonnull String identifier, @Nonnull Comparison.Side left, @Nonnull Comparison.Side right, boolean isPublic, @Nonnull Instant creationTime, @Nullable Instant expiryTime, boolean ready, @Nullable Instant readyTime, @Nullable Boolean failed, @Nullable String errorMessage) Creates a representation of a comparison that has been created.- Parameters:
identifier
- The comparison's identifier.left
- Representation of the left file.right
- Representation of the right file.isPublic
- Whether the comparison is public or private.creationTime
- When the comparison was created.expiryTime
- When the comparison expires, or null if it doesn't expire.ready
- Whether the comparison has been processed.readyTime
- If the comparison is ready, the time at which it became ready.failed
- Whether the comparison failed. Is null if the comparison hasn't been processed.errorMessage
- If the comparison failed, gives an error message describing the failure. Null otherwise.
-
-
Method Details
-
getIdentifier
Gets the comparison's identifier.- Returns:
- The comparison's identifier.
-
getLeft
Gets metadata for the left file.- Returns:
- Metadata for the left file.
-
getRight
Gets metadata for the right file.- Returns:
- Metadata for the right file.
-
getIsPublic
public final boolean getIsPublic()Gets whether the comparison is public or private.- Returns:
- true if the comparison is public, false otherwise.
-
getCreationTime
Gets when the comparison was created.- Returns:
- When the comparison was created.
-
getExpiryTime
Gets when the comparison expires, or null if it doesn't expire.- Returns:
- When the comparison expires, or null if it doesn't expire.
-
getReady
public final boolean getReady()Gets whether the comparison has been processed.- Returns:
- true if the comparison has been processed, false otherwise.
-
getReadyTime
If the comparison is ready, gives the time at which processing finished.- Returns:
- When the comparison became ready, or null if it's not ready yet.
-
getFailed
Gets whether the comparison failed. Is null if the comparison hasn't been processed (i.e. isn't ready).- Returns:
- true if the comparison failed, false if the comparison is ready and succeeded, and null if the comparison isn't ready.
-
getErrorMessage
If the comparison failed, gets an message describing error. Otherwise, returns null.- Returns:
- A message describing the error if the comparison has failed. Null if the comparison isn't ready or succeeded.
-
toString
-