@Test public void testEquals() throws Exception { RyaStatementWritable rsw1 = new RyaStatementWritable(rs1, ryaContext); RyaStatementWritable rsw1b = new RyaStatementWritable(rs1b, null); RyaStatementWritable rsw2 = new RyaStatementWritable(rs2, ryaContext); RyaStatementWritable rswNull = new RyaStatementWritable(null, ryaContext); Assert.assertEquals("Equivalent statements should be equal", rsw1, rsw1b); Assert.assertFalse("equals(null) should be false", rsw1.equals(null)); Assert.assertNotEquals("Statements representing different triples are not equal", rsw1, rsw2); Assert.assertNotEquals("Statements representing different triples are not equal", rsw1, rswNull); Assert.assertNotEquals("Statements with different named graphs are not equal", rsw1, new RyaStatementWritable(rsGraph, ryaContext)); Assert.assertNotEquals("Statements with different column visibilities are not equal", rsw1, new RyaStatementWritable(rsCv, ryaContext)); Assert.assertNotEquals("Statements with different column qualifiers are not equal", rsw1, new RyaStatementWritable(rsQualifier, ryaContext)); Assert.assertNotEquals("Statements with different timestamps are not equal", rsw1, new RyaStatementWritable(rsTimestamp, ryaContext)); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof RyaStatementWritable)) { return false; } RyaStatement rsThis = this.getRyaStatement(); RyaStatement rsOther = ((RyaStatementWritable) o).getRyaStatement(); if (rsThis == null) { return rsOther == null; } else { return rsThis.equals(rsOther); } }
RyaStatementWritable implements WritableComparable<RyaStatementWritable> { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof RyaStatementWritable)) { return false; } RyaStatement rsThis = this.getRyaStatement(); RyaStatement rsOther = ((RyaStatementWritable) o).getRyaStatement(); if (rsThis == null) { return rsOther == null; } else { return rsThis.equals(rsOther); } } }
RyaStatementWritable implements WritableComparable<RyaStatementWritable> { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof RyaStatementWritable)) { return false; } RyaStatement rsThis = this.getRyaStatement(); RyaStatement rsOther = ((RyaStatementWritable) o).getRyaStatement(); if (rsThis == null) { return rsOther == null; } else { return rsThis.equals(rsOther); } } RyaStatementWritable(Configuration conf);  RyaStatementWritable(RyaTripleContext ryaContext);  RyaStatementWritable();  RyaStatementWritable(RyaStatement ryaStatement, RyaTripleContext ryaContext); }
RyaStatementWritable implements WritableComparable<RyaStatementWritable> { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof RyaStatementWritable)) { return false; } RyaStatement rsThis = this.getRyaStatement(); RyaStatement rsOther = ((RyaStatementWritable) o).getRyaStatement(); if (rsThis == null) { return rsOther == null; } else { return rsThis.equals(rsOther); } } RyaStatementWritable(Configuration conf);  RyaStatementWritable(RyaTripleContext ryaContext);  RyaStatementWritable();  RyaStatementWritable(RyaStatement ryaStatement, RyaTripleContext ryaContext); RyaStatement getRyaStatement(); void setRyaStatement(RyaStatement ryaStatement); @Override int compareTo(RyaStatementWritable other); @Override int hashCode(); @Override boolean equals(Object o); @Override void write(DataOutput dataOutput); @Override void readFields(DataInput dataInput); }
RyaStatementWritable implements WritableComparable<RyaStatementWritable> { @Override public boolean equals(Object o) { if (o == this) { return true; } if (o == null || !(o instanceof RyaStatementWritable)) { return false; } RyaStatement rsThis = this.getRyaStatement(); RyaStatement rsOther = ((RyaStatementWritable) o).getRyaStatement(); if (rsThis == null) { return rsOther == null; } else { return rsThis.equals(rsOther); } } RyaStatementWritable(Configuration conf);  RyaStatementWritable(RyaTripleContext ryaContext);  RyaStatementWritable();  RyaStatementWritable(RyaStatement ryaStatement, RyaTripleContext ryaContext); RyaStatement getRyaStatement(); void setRyaStatement(RyaStatement ryaStatement); @Override int compareTo(RyaStatementWritable other); @Override int hashCode(); @Override boolean equals(Object o); @Override void write(DataOutput dataOutput); @Override void readFields(DataInput dataInput);  }