@Override public int hashCode() { if (attributeModifiers == null) getModifiers(); return Objects.hashCode(getAttributeKey(), getBaseValue(), attributeModifiers); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj instanceof WrappedAttribute) { WrappedAttribute other = (WrappedAttribute) obj; if (getBaseValue() == other.getBaseValue() && Objects.equal(getAttributeKey(), other.getAttributeKey())) { return getModifiers().stream() .filter((elem) -> !other.getModifiers().contains(elem)) .count() == 0; } } return false; }
private Builder(WrappedAttribute template) { if (template != null) { baseValue = template.getBaseValue(); attributeKey = template.getAttributeKey(); packet = template.getParentPacket(); modifiers = template.getModifiers(); } }
@Override public String toString() { return "WrappedAttribute[key=" + getAttributeKey() + ", base=" + getBaseValue() + ", final=" + getFinalValue() + ", modifiers=" + getModifiers() + "]"; }
double x = getBaseValue(); double y = 0;