static String toString(final DecimalTypeDefinition type) { return TypeDefinitions.toStringHelper(type).add("fractionDigits", type.getFractionDigits()).toString(); } }
@Override public int getFractionDigits() { return baseType().getFractionDigits(); }
static String toString(final DecimalTypeDefinition type) { return TypeDefinitions.toStringHelper(type).add("fractionDigits", type.getFractionDigits()).toString(); } }
@Override public int getFractionDigits() { return getBaseType().getFractionDigits(); }
@Override public int getFractionDigits() { return getBaseType().getFractionDigits(); }
@Override public int getFractionDigits() { return baseType().getFractionDigits(); }
static boolean equals(final DecimalTypeDefinition type, final Object obj) { if (type == obj) { return true; } final DecimalTypeDefinition other = TypeDefinitions.castIfEquals(DecimalTypeDefinition.class, type, obj); return other != null && type.getFractionDigits() == other.getFractionDigits() && type.getRangeConstraint().equals(other.getRangeConstraint()); }
static boolean equals(final DecimalTypeDefinition type, final Object obj) { if (type == obj) { return true; } final DecimalTypeDefinition other = TypeDefinitions.castIfEquals(DecimalTypeDefinition.class, type, obj); return other != null && type.getFractionDigits() == other.getFractionDigits() && type.getRangeConstraint().equals(other.getRangeConstraint()); }
private void emitDecimal64Specification(final DecimalTypeDefinition typeDefinition) { emitFranctionDigitsNode(typeDefinition.getFractionDigits()); emitRangeRestrictedSpecification(typeDefinition); }
static int hashCode(final DecimalTypeDefinition type) { return Objects.hash(type.getPath(), type.getUnknownSchemaNodes(), type.getBaseType(), type.getUnits().orElse(null), type.getDefaultValue().orElse(null), type.getFractionDigits(), type.getRangeConstraint().orElse(null)); }
static int hashCode(final DecimalTypeDefinition type) { return Objects.hash(type.getPath(), type.getUnknownSchemaNodes(), type.getBaseType(), type.getUnits().orElse(null), type.getDefaultValue().orElse(null), type.getFractionDigits(), type.getRangeConstraint().orElse(null)); }
final DecimalTypeDefinition decimal = (DecimalTypeDefinition) type; final DecimalTypeBuilder tmpBuilder = BaseTypes.decimalTypeBuilder(decimal.getPath()); tmpBuilder.setFractionDigits(decimal.getFractionDigits()); final DecimalTypeDefinition tmp = tmpBuilder.build();
final DecimalTypeDefinition decimal = (DecimalTypeDefinition) type; final DecimalTypeBuilder tmpBuilder = BaseTypes.decimalTypeBuilder(decimal.getPath()); tmpBuilder.setFractionDigits(decimal.getFractionDigits()); final DecimalTypeDefinition tmp = tmpBuilder.build();
DecimalTypeEffectiveStatementImpl( final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx, final DecimalTypeDefinition baseType) { super(ctx); final RangeRestrictedTypeBuilder<DecimalTypeDefinition, BigDecimal> builder = RestrictedTypes.newDecima64Builder(baseType, AbstractTypeStatementSupport.typeEffectiveSchemaPath(ctx)); for (EffectiveStatement<?, ?> stmt : effectiveSubstatements()) { if (stmt instanceof RangeEffectiveStatementImpl) { final RangeEffectiveStatementImpl range = (RangeEffectiveStatementImpl) stmt; builder.setRangeConstraint(range, range.argument()); } if (stmt instanceof FractionDigitsEffectiveStatement) { final Integer digits = ((FractionDigitsEffectiveStatement)stmt).argument(); SourceException.throwIf(baseType.getFractionDigits() != digits, ctx.getStatementSourceReference(), "Cannot override fraction-digits from base type %s to %s", baseType, digits); } if (stmt instanceof UnknownSchemaNode) { builder.addUnknownSchemaNode((UnknownSchemaNode)stmt); } } typeDefinition = builder.build(); }