package com.keuin.kbackupfabric.util.backup.incremental; import com.keuin.kbackupfabric.util.backup.incremental.identifier.ObjectIdentifier; import java.util.Objects; import java.util.Set; public class ObjectCollection { private final String name; private final Set elements; private final Set subCollections; ObjectCollection(String name, Set elements, Set subCollections) { this.name = Objects.requireNonNull(name); this.elements = Objects.requireNonNull(elements); this.subCollections = Objects.requireNonNull(subCollections); } public String getName() { return name; } public Set getElements() { return elements; } public Set getSubCollections() { return subCollections; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ObjectCollection that = (ObjectCollection) o; return name.equals(that.name) && elements.equals(that.elements) && subCollections.equals(that.subCollections); } @Override public int hashCode() { return Objects.hash(name, elements, subCollections); } }