public static ObjectId hashTree(@Nullable List<Node> trees, @Nullable List<Node> features, @Nullable Iterable<Bucket> buckets) { final Hasher hasher = ObjectId.HASH_FUNCTION.newHasher(); trees = trees == null ? ImmutableList.of() : trees; features = features == null ? ImmutableList.of() : features; buckets = buckets == null ? Collections.emptySet() : buckets; HashObjectFunnels.tree(hasher, trees, features, buckets); final byte[] rawKey = hasher.hash().asBytes(); final ObjectId id = ObjectId.create(rawKey); return id; }
public static ObjectId hashTree(@Nullable List<Node> trees, @Nullable List<Node> features, @Nullable Iterable<Bucket> buckets) { final List<Node> t = trees == null ? ImmutableList.of() : trees; final List<Node> f = features == null ? ImmutableList.of() : features; final Iterable<Bucket> b = buckets == null ? Collections.emptySet() : buckets; return hash(h -> HashObjectFunnels.tree(h, t, f, b)); }
@Deprecated public static ObjectId hashTree(@Nullable List<Node> trees, @Nullable List<Node> features, @Nullable SortedMap<Integer, Bucket> buckets) { final List<Node> t = trees == null ? ImmutableList.of() : trees; final List<Node> f = features == null ? ImmutableList.of() : features; final Iterable<Bucket> b = buckets == null ? Collections.emptySet() : buckets.values(); return hash(h -> HashObjectFunnels.tree(h, t, f, b)); }
public static ObjectId hashTree(@Nullable List<Node> trees, @Nullable List<Node> features, @Nullable SortedMap<Integer, Bucket> buckets) { final Hasher hasher = ObjectId.HASH_FUNCTION.newHasher(); trees = trees == null ? ImmutableList.of() : trees; features = features == null ? ImmutableList.of() : features; buckets = buckets == null ? ImmutableSortedMap.of() : buckets; HashObjectFunnels.tree(hasher, trees, features, buckets); final byte[] rawKey = hasher.hash().asBytes(); final ObjectId id = ObjectId.createNoClone(rawKey); return id; }
@Deprecated public static ObjectId hashTree(@Nullable List<Node> trees, @Nullable List<Node> features, @Nullable SortedMap<Integer, Bucket> buckets) { final Hasher hasher = ObjectId.HASH_FUNCTION.newHasher(); trees = trees == null ? ImmutableList.of() : trees; features = features == null ? ImmutableList.of() : features; buckets = buckets == null ? ImmutableSortedMap.of() : buckets; HashObjectFunnels.tree(hasher, trees, features, buckets.values()); final byte[] rawKey = hasher.hash().asBytes(); final ObjectId id = ObjectId.create(rawKey); return id; }
public static ObjectId hashTree(@Nullable List<Node> trees, @Nullable List<Node> features, @Nullable SortedMap<Integer, Bucket> buckets) { final List<Node> t = trees == null ? ImmutableList.of() : trees; final List<Node> f = features == null ? ImmutableList.of() : features; final SortedMap<Integer, Bucket> b = buckets == null ? ImmutableSortedMap.of() : buckets; return hash((h) -> HashObjectFunnels.tree(h, t, f, b)); }