@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof TDataType)) return false; if (!super.equals(o)) return false; TDataType dataType = (TDataType) o; return Objects.equals(getConstraints(), dataType.getConstraints()); }
public TDataType build() { return new TDataType(this); } }
public TDataType(Builder builder) { super(builder); this.setConstraints(builder.constraints); }
@Override public Result visit(TDataType node, Parameter parameter) { validateEntityType(node, parameter, typeVisitor.getDataTypes()); // Extend a native DataType should fail if (Objects.nonNull(node.getDerivedFrom()) && (Defaults.YAML_TYPES.contains(node.getDerivedFrom().getLocalPart()) || Defaults.TOSCA_TYPES.contains(node.getDerivedFrom().getLocalPart()) ) && !node.getProperties().isEmpty()) { setException(new InvalidTypeExtend( "The native data type '{}' cannot be extended with properties!", parameter.getKey() ).setContext(parameter.getContext()) ); } return super.visit(node, parameter); }
for (Map.Entry<String, TPropertyDefinition> entry : node.getProperties().entrySet()) { QName type = entry.getValue().getType(); buildPlan.put(entry.getKey(), entry.getValue().getType()); this.data_types.get(type.getLocalPart()).accept(this, parameter.copy().addContext(type.getLocalPart()).setDatatype(type)); builder.addElements(entry.getKey(), entry.getValue());
for (Map.Entry<String, TDataType> entry : node.getDataTypes().entrySet()) { if (entry.getValue() != null) { entry.getValue().accept(this, parameter.copy().addContext("datatypes", entry.getKey())); && this.localDatatypeNames.contains(type.getLocalPart())) { node.getDataTypes().get(parameter.getDatatype().getLocalPart()) .accept(this, parameter.copy().addContext("datatypes", parameter.getDatatype().getLocalPart()));
@Override public Result visit(TDataType node, Parameter parameter) { this.setDataTypes(namespace, parameter.getKey()); setNormativeTypes(parameter.getKey(), node.getMetadata(), dataTypes); super.visit(node, parameter); return null; }
@Override public String toString() { return "TDataType{" + "constraints=" + getConstraints() + "} " + super.toString(); }
@Override public int hashCode() { return Objects.hash(super.hashCode(), getConstraints()); }
@Override public R visit(TDataType node, P parameter) { return visitElement(node.getConstraints(), parameter, "constraints"); }
public Printer visit(TDataType node, Parameter parameter) { return new Printer(parameter.getIndent()) .print(printList("constraints", node.getConstraints(), parameter)); }