Class SnapshotIndex
- java.lang.Object
-
- io.datareplication.model.snapshot.SnapshotIndex
-
public final class SnapshotIndex extends java.lang.ObjectThe index of a snapshot. In addition to some metadata, this primarily contains of a list of URLs to the pages that make up this snapshot.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSnapshotIndex.ParsingExceptionParsingException occurs when a SnapshotIndex can't be parsed
-
Constructor Summary
Constructors Constructor Description SnapshotIndex(@NonNull SnapshotId id, @NonNull java.time.Instant createdAt, @NonNull java.util.List<@NonNull Url> pages)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull java.time.InstantcreatedAt()The timestamp of the dataset contained in this snapshot.booleanequals(java.lang.Object o)static @NonNull SnapshotIndexfromJson(@NonNull Body json)Parses Tries to parse JSON a SnapshotIndexinthashCode()@NonNull SnapshotIdid()The ID of the snapshot.@NonNull java.util.List<@NonNull Url>pages()The URLs of the pages that make up this snapshot.@NonNull BodytoJson()Converts this Snapshot instance to a Bodyjava.lang.StringtoString()
-
-
-
Constructor Detail
-
SnapshotIndex
public SnapshotIndex(@NonNull @NonNull SnapshotId id, @NonNull @NonNull java.time.Instant createdAt, @NonNull @NonNull java.util.List<@NonNull Url> pages)
-
-
Method Detail
-
toJson
@NonNull public @NonNull Body toJson()
Converts this Snapshot instance to a Body- Returns:
- the converted Body
-
fromJson
@NonNull public static @NonNull SnapshotIndex fromJson(@NonNull @NonNull Body json) throws java.io.IOException
Parses Tries to parse JSON a SnapshotIndex- Parameters:
json- the json representation of a SnapshotIndex- Returns:
- the parsed SnapshotIndex
- Throws:
SnapshotIndex.ParsingException- if JSON is not a SnapshotIndexjava.io.IOException- if the underlying Body throws an IOException
-
id
@NonNull public @NonNull SnapshotId id()
The ID of the snapshot.
-
createdAt
@NonNull public @NonNull java.time.Instant createdAt()
The timestamp of the dataset contained in this snapshot. This is usually the time when snapshot creation started.
-
pages
@NonNull public @NonNull java.util.List<@NonNull Url> pages()
The URLs of the pages that make up this snapshot.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-