@Test public void Equals() { Block block1 = Blocks.graphFilter(new QNODE<UID>(UID.class, "c"), Blocks.SPO); Block block2 = Blocks.graphFilter(new QNODE<UID>(UID.class, "c"), Blocks.SPOC); Block block3 = Blocks.graphFilter(new QNODE<UID>(UID.class, "d"), Blocks.SPO); assertFalse(block1.equals(block2)); assertFalse(block1.equals(block3)); assertFalse(block2.equals(block3)); }
@Override public boolean equals(Object o) { if (o == this) { return true; } else if (o instanceof GraphBlock) { GraphBlock gb = (GraphBlock) o; return context.equals(gb.context) && Objects.equal(filters, gb.filters) && blocks.equals(gb.blocks); } else { return false; } }
GraphBlock implements ContainerBlock { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (o instanceof GraphBlock) { GraphBlock gb = (GraphBlock) o; return context.equals(gb.context) && Objects.equal(filters, gb.filters) && blocks.equals(gb.blocks); } else { return false; } } }
GraphBlock implements ContainerBlock { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (o instanceof GraphBlock) { GraphBlock gb = (GraphBlock) o; return context.equals(gb.context) && Objects.equal(filters, gb.filters) && blocks.equals(gb.blocks); } else { return false; } } GraphBlock(Expression<UID> context, List<Block> blocks, Predicate... filters); }
GraphBlock implements ContainerBlock { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (o instanceof GraphBlock) { GraphBlock gb = (GraphBlock) o; return context.equals(gb.context) && Objects.equal(filters, gb.filters) && blocks.equals(gb.blocks); } else { return false; } } GraphBlock(Expression<UID> context, List<Block> blocks, Predicate... filters); @Override Predicate not(); @Override @SuppressWarnings("unchecked") R accept(Visitor<R, C> v, C context); @Override Class<? extends Boolean> getType(); List<Block> getBlocks(); @Nullable Predicate getFilters(); Expression<UID> getContext(); @Override BooleanExpression exists(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
GraphBlock implements ContainerBlock { @Override public boolean equals(Object o) { if (o == this) { return true; } else if (o instanceof GraphBlock) { GraphBlock gb = (GraphBlock) o; return context.equals(gb.context) && Objects.equal(filters, gb.filters) && blocks.equals(gb.blocks); } else { return false; } } GraphBlock(Expression<UID> context, List<Block> blocks, Predicate... filters); @Override Predicate not(); @Override @SuppressWarnings("unchecked") R accept(Visitor<R, C> v, C context); @Override Class<? extends Boolean> getType(); List<Block> getBlocks(); @Nullable Predicate getFilters(); Expression<UID> getContext(); @Override BooleanExpression exists(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }