Class SnapshotIndex


  • public final class SnapshotIndex
    extends java.lang.Object
    The 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 class  SnapshotIndex.ParsingException
      ParsingException 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.Instant createdAt()
      The timestamp of the dataset contained in this snapshot.
      boolean equals​(java.lang.Object o)  
      static @NonNull SnapshotIndex fromJson​(@NonNull Body json)
      Parses Tries to parse JSON a SnapshotIndex
      int hashCode()  
      @NonNull SnapshotId id()
      The ID of the snapshot.
      @NonNull java.util.List<@NonNull Url> pages()
      The URLs of the pages that make up this snapshot.
      @NonNull Body toJson()
      Converts this Snapshot instance to a Body
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 SnapshotIndex
        java.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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object