@Test(expected = IllegalArgumentException.class) public void verify_subclasses() { PolymorphicObjectType.of( BasicObjectType.of(getTypeDescriptor(A.class)), ImmutableList.of(BasicObjectType.of(getTypeDescriptor(B.class), "B")) ); }
public static PolymorphicObjectType of(BasicObjectType root, List<BasicObjectType> subclasses) { if (root.getIdentifier() != null) { return new Identifiable(root, subclasses); } else { return new PolymorphicObjectType(root, subclasses); } }
PolymorphicObjectType implements ObjectType { public static PolymorphicObjectType of(BasicObjectType root, List<BasicObjectType> subclasses) { if (root.getIdentifier() != null) { return new Identifiable(root, subclasses); } else { return new PolymorphicObjectType(root, subclasses); } } }
PolymorphicObjectType implements ObjectType { public static PolymorphicObjectType of(BasicObjectType root, List<BasicObjectType> subclasses) { if (root.getIdentifier() != null) { return new Identifiable(root, subclasses); } else { return new PolymorphicObjectType(root, subclasses); } } private  PolymorphicObjectType(BasicObjectType root, List<BasicObjectType> subclasses); }
PolymorphicObjectType implements ObjectType { public static PolymorphicObjectType of(BasicObjectType root, List<BasicObjectType> subclasses) { if (root.getIdentifier() != null) { return new Identifiable(root, subclasses); } else { return new PolymorphicObjectType(root, subclasses); } } private  PolymorphicObjectType(BasicObjectType root, List<BasicObjectType> subclasses); static PolymorphicObjectType of(BasicObjectType root,
                                           List<BasicObjectType> subclasses); @Override Object instantiate(PropertyTree propertyTree, Object valueObject, ReadContext context); @Override void bind(PropertyTree propertyTree, Object object, ReadContext context); @Override void serialize(PropertyPath path, Object object, WriteContext context); @Override ObjectIdentifier getIdentifier(); @Override Map<String, AccessibleProperty> getProperties(); NodeId toNodeId(Object object, WriteContext writeContext); String toString(); }
PolymorphicObjectType implements ObjectType { public static PolymorphicObjectType of(BasicObjectType root, List<BasicObjectType> subclasses) { if (root.getIdentifier() != null) { return new Identifiable(root, subclasses); } else { return new PolymorphicObjectType(root, subclasses); } } private  PolymorphicObjectType(BasicObjectType root, List<BasicObjectType> subclasses); static PolymorphicObjectType of(BasicObjectType root,
                                           List<BasicObjectType> subclasses); @Override Object instantiate(PropertyTree propertyTree, Object valueObject, ReadContext context); @Override void bind(PropertyTree propertyTree, Object object, ReadContext context); @Override void serialize(PropertyPath path, Object object, WriteContext context); @Override ObjectIdentifier getIdentifier(); @Override Map<String, AccessibleProperty> getProperties(); NodeId toNodeId(Object object, WriteContext writeContext); String toString();  }