@Test public void testEquals() throws Exception { Angle theAngle1 = new Angle(10); Angle theAngle2 = new Angle(10); Angle theAngle3 = new Angle(11); assertEquals(theAngle1, theAngle1); assertEquals(theAngle1, theAngle2); assertNotEquals(theAngle1, "lala"); assertNotEquals(theAngle1, null); assertNotEquals(theAngle1, theAngle3); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Angle angle = (Angle) o; return angleInDegrees == angle.angleInDegrees; }
Angle implements Reflectable, Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Angle angle = (Angle) o; return angleInDegrees == angle.angleInDegrees; } }
Angle implements Reflectable, Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Angle angle = (Angle) o; return angleInDegrees == angle.angleInDegrees; } Angle(int aAngleInDegrees); }
Angle implements Reflectable, Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Angle angle = (Angle) o; return angleInDegrees == angle.angleInDegrees; } Angle(int aAngleInDegrees); Integer get(); @ReflectiveMethod Angle add(int aDiff); @ReflectiveMethod Angle invert(); @ReflectiveMethod Angle snapTo(int aStep); @ReflectiveMethod Angle resetToZero(); float toRadians(); @Override boolean equals(Object o); @Override int hashCode(); @Override AngleClassInformation getClassInformation(); @Override Map<String, Object> serialize(); static Angle deserialize(Map<String, Object> aSerializedData); static Angle fromRadians(float aAngleInRadians); }
Angle implements Reflectable, Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Angle angle = (Angle) o; return angleInDegrees == angle.angleInDegrees; } Angle(int aAngleInDegrees); Integer get(); @ReflectiveMethod Angle add(int aDiff); @ReflectiveMethod Angle invert(); @ReflectiveMethod Angle snapTo(int aStep); @ReflectiveMethod Angle resetToZero(); float toRadians(); @Override boolean equals(Object o); @Override int hashCode(); @Override AngleClassInformation getClassInformation(); @Override Map<String, Object> serialize(); static Angle deserialize(Map<String, Object> aSerializedData); static Angle fromRadians(float aAngleInRadians); final int angleInDegrees; static final Angle ZERO; }