@Test public void testEquals() throws Exception { TextExpression theExpression = new TextExpression("test"); TextExpression theExpression1 = new TextExpression("test"); TextExpression theExpression2 = new TextExpression("lala"); assertEquals(theExpression, theExpression); assertEquals(theExpression, theExpression1); assertNotEquals(theExpression, theExpression2); assertNotEquals(theExpression, "lala"); assertNotEquals(theExpression, null); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TextExpression that = (TextExpression) o; return expression.equals(that.expression); }
TextExpression implements Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TextExpression that = (TextExpression) o; return expression.equals(that.expression); } }
TextExpression implements Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TextExpression that = (TextExpression) o; return expression.equals(that.expression); } TextExpression(String aExpression); }
TextExpression implements Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TextExpression that = (TextExpression) o; return expression.equals(that.expression); } TextExpression(String aExpression); String get(); @Override boolean equals(Object o); @Override int hashCode(); @Override Map<String, Object> serialize(); static TextExpression deserialize(Map<String,Object> aSerializedData); }
TextExpression implements Distributable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TextExpression that = (TextExpression) o; return expression.equals(that.expression); } TextExpression(String aExpression); String get(); @Override boolean equals(Object o); @Override int hashCode(); @Override Map<String, Object> serialize(); static TextExpression deserialize(Map<String,Object> aSerializedData); final String expression; }