Java Code Examples for io.swagger.models.properties.FloatProperty#getDefault()

The following examples show how to use io.swagger.models.properties.FloatProperty#getDefault() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ElmClientCodegen.java    From TypeScript-Microservices with MIT License 4 votes vote down vote up
@Override
public String toDefaultValue(Property p) {
    if (p instanceof StringProperty) {
        StringProperty sp = (StringProperty) p;
        if (sp.getDefault() != null) {
            return toOptionalValue("\"" + sp.getDefault().toString() + "\"");
        }
        return toOptionalValue(null);
    } else if (p instanceof BooleanProperty) {
        BooleanProperty bp = (BooleanProperty) p;
        if (bp.getDefault() != null) {
            return toOptionalValue(bp.getDefault() ? "True" : "False");
        }
        return toOptionalValue(null);
    } else if (p instanceof DateProperty) {
        return toOptionalValue(null);
    } else if (p instanceof DateTimeProperty) {
        return toOptionalValue(null);
    } else if (p instanceof DoubleProperty) {
        DoubleProperty dp = (DoubleProperty) p;
        if (dp.getDefault() != null) {
            return toOptionalValue(dp.getDefault().toString());
        }
        return toOptionalValue(null);
    } else if (p instanceof FloatProperty) {
        FloatProperty fp = (FloatProperty) p;
        if (fp.getDefault() != null) {
            return toOptionalValue(fp.getDefault().toString());
        }
        return toOptionalValue(null);
    } else if (p instanceof IntegerProperty) {
        IntegerProperty ip = (IntegerProperty) p;
        if (ip.getDefault() != null) {
            return toOptionalValue(ip.getDefault().toString());
        }
        return toOptionalValue(null);
    } else if (p instanceof LongProperty) {
        LongProperty lp = (LongProperty) p;
        if (lp.getDefault() != null) {
            return toOptionalValue(lp.getDefault().toString());
        }
        return toOptionalValue(null);
    } else {
        return toOptionalValue(null);
    }
}
 
Example 2
Source File: AbstractTypeScriptClientCodegen.java    From TypeScript-Microservices with MIT License 4 votes vote down vote up
@Override
public String toDefaultValue(Property p) {
    if (p instanceof StringProperty) {
        StringProperty sp = (StringProperty) p;
        if (sp.getDefault() != null) {
            return "'" + sp.getDefault() + "'";
        }
        return UNDEFINED_VALUE;
    } else if (p instanceof BooleanProperty) {
        return UNDEFINED_VALUE;
    } else if (p instanceof DateProperty) {
        return UNDEFINED_VALUE;
    } else if (p instanceof DateTimeProperty) {
        return UNDEFINED_VALUE;
    } else if (p instanceof DoubleProperty) {
        DoubleProperty dp = (DoubleProperty) p;
        if (dp.getDefault() != null) {
            return dp.getDefault().toString();
        }
        return UNDEFINED_VALUE;
    } else if (p instanceof FloatProperty) {
        FloatProperty fp = (FloatProperty) p;
        if (fp.getDefault() != null) {
            return fp.getDefault().toString();
        }
        return UNDEFINED_VALUE;
    } else if (p instanceof IntegerProperty) {
        IntegerProperty ip = (IntegerProperty) p;
        if (ip.getDefault() != null) {
            return ip.getDefault().toString();
        }
        return UNDEFINED_VALUE;
    } else if (p instanceof LongProperty) {
        LongProperty lp = (LongProperty) p;
        if (lp.getDefault() != null) {
            return lp.getDefault().toString();
        }
        return UNDEFINED_VALUE;
    } else {
        return UNDEFINED_VALUE;
    }
}