@Override public Hasher putBoolean(boolean b) { for (Hasher hasher : hashers) { hasher.putBoolean(b); } return this; }
public StatisticsHasher putBoolean(boolean value) { hasher.putBoolean(value); return this; }
@Override public Hasher putBoolean(boolean b) { for (Hasher hasher : hashers) { hasher.putBoolean(b); } return this; }
@Override public Hasher putBoolean(boolean b) { for (Hasher hasher : hashers) { hasher.putBoolean(b); } return this; }
public StatisticsHasher putOptionalDouble(boolean present, double value) { hasher.putBoolean(present); hasher.putDouble(present ? value : 0); return this; }
public StatisticsHasher putOptionalInt(boolean present, int value) { hasher.putBoolean(present); hasher.putInt(present ? value : 0); return this; }
public StatisticsHasher putOptionalLong(boolean present, long value) { hasher.putBoolean(present); hasher.putLong(present ? value : 0); return this; }
public StatisticsHasher putOptionalHashable(Hashable value) { hasher.putBoolean(value != null); if (value != null) { value.addHash(this); } return this; }
public StatisticsHasher putOptionalBigDecimal(BigDecimal value) { hasher.putBoolean(value != null); if (value != null) { // this should really be 128 bits hasher.putInt(value.scale()); hasher.putBytes(value.unscaledValue().toByteArray()); } return this; }
public StatisticsHasher putOptionalSlice(Slice value) { hasher.putBoolean(value != null); if (value != null) { // there are better ways to do this, but values are limited to 64 bytes hasher.putBytes(value.getBytes()); } return this; }
.putBoolean(true) .putBoolean(true) .putBoolean(false) .putBoolean(true) .putBoolean(false) .putBoolean(false) .putBoolean(false) .putBoolean(false); final long hashCode = hasher.hash().asLong();
@Override public void writeBoolean(boolean v) { hasher.putBoolean(v); }
public Consumer<Boolean> bool() { return value -> { putKind(Kind.BOOLEAN); hasher.putBoolean(value); }; }
@Override public Hasher putBoolean(boolean b) { for (Hasher hasher : hashers) { hasher.putBoolean(b); } return this; }
public StatisticsHasher putOptionalLong(boolean present, long value) { hasher.putBoolean(present); hasher.putLong(present ? value : 0); return this; }
public StatisticsHasher putOptionalHashable(Hashable value) { hasher.putBoolean(value != null); if (value != null) { value.addHash(this); } return this; }
public StatisticsHasher putOptionalInt(boolean present, int value) { hasher.putBoolean(present); hasher.putInt(present ? value : 0); return this; }
public StatisticsHasher putOptionalDouble(boolean present, double value) { hasher.putBoolean(present); hasher.putDouble(present ? value : 0); return this; }
public StatisticsHasher putOptionalBigDecimal(BigDecimal value) { hasher.putBoolean(value != null); if (value != null) { // this should really be 128 bits hasher.putInt(value.scale()); hasher.putBytes(value.unscaledValue().toByteArray()); } return this; }
public StatisticsHasher putOptionalSlice(Slice value) { hasher.putBoolean(value != null); if (value != null) { // there are better ways to do this, but values are limited to 64 bytes hasher.putBytes(value.getBytes()); } return this; }