public void addStereotype( Stereotype<Protocol, Format> stereotype ) { stereotypes.addStereotype( stereotype ); }
public boolean hasStereotype( String name ) { if( name == null ) return false; return stereotypes.getStereotypeFor( name ) != null; }
public Collection<String> getStereotypeNames() { return stereotypes.getStereotypeNames(); }
public boolean removeStereotype( String name ) { return stereotypes.removeStereotype( name ); }
public boolean renameStereotype( String name, String newName ) { return stereotypes.renameStereotype( name, newName ); }
public Stereotype<Protocol, Format> getStereotypeFor( Fields fields ) { return fieldsToStereotype.get( normalize( fields ) ); }
@JsonCreator public Stereotypes( Collection<Stereotype<Protocol, Format>> stereotypes ) { setStereotypes( stereotypes ); }
@Override public int hashCode() { int result = super.hashCode(); result = 31 * result + ( stereotypes != null ? stereotypes.hashCode() : 0 ); result = 31 * result + ( childSchemas != null ? childSchemas.hashCode() : 0 ); result = 31 * result + ( childTables != null ? childTables.hashCode() : 0 ); result = 31 * result + ( protocolProperties != null ? protocolProperties.hashCode() : 0 ); result = 31 * result + ( formatProperties != null ? formatProperties.hashCode() : 0 ); return result; } }
@Override public boolean equals( Object object ) { if( this == object ) return true; if( !( object instanceof SchemaDef ) ) return false; if( !super.equals( object ) ) return false; SchemaDef schemaDef = (SchemaDef) object; if( childSchemas != null ? !childSchemas.equals( schemaDef.childSchemas ) : schemaDef.childSchemas != null ) return false; if( childTables != null ? !childTables.equals( schemaDef.childTables ) : schemaDef.childTables != null ) return false; if( formatProperties != null ? !formatProperties.equals( schemaDef.formatProperties ) : schemaDef.formatProperties != null ) return false; if( protocolProperties != null ? !protocolProperties.equals( schemaDef.protocolProperties ) : schemaDef.protocolProperties != null ) return false; if( stereotypes != null ? !stereotypes.equals( schemaDef.stereotypes ) : schemaDef.stereotypes != null ) return false; return true; }
@JsonSetter public void setStereotypes( Collection<Stereotype<Protocol, Format>> stereotypes ) { for( Stereotype<Protocol, Format> stereotype : stereotypes ) addStereotype( stereotype ); }
public Stereotype<Protocol, Format> getStereotype( String stereotypeName ) { if( stereotypeName == null || stereotypeName.isEmpty() ) return null; return stereotypes.getStereotypeFor( stereotypeName ); }
public boolean renameStereotype( String name, String newName ) { Stereotype<Protocol, Format> stereotype = nameToStereotype.remove( name ); if( stereotype == null ) return false; fieldsToStereotype.remove( stereotype.getFields() ); addStereotype( new Stereotype<Protocol, Format>( stereotype, newName ) ); return true; }
public Stereotype<Protocol, Format> findStereotypeFor( String stereotypeName ) { Stereotype<Protocol, Format> stereotype = stereotypes.getStereotypeFor( stereotypeName ); if( stereotype != null || isRoot() ) return stereotype; return getParentSchema().findStereotypeFor( stereotypeName ); }
public Stereotype<Protocol, Format> findStereotypeFor( Fields fields ) { Stereotype<Protocol, Format> stereotype = stereotypes.getStereotypeFor( fields ); if( stereotype != null || isRoot() ) return stereotype; return getParentSchema().findStereotypeFor( fields ); }