All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.swagger.models.properties.DateTimeProperty Maven / Gradle / Ivy

There is a newer version: 2.0.0-rc2
Show newest version
package io.swagger.models.properties;

import io.swagger.models.Xml;

import java.util.ArrayList;
import java.util.List;

public class DateTimeProperty extends AbstractProperty implements Property {
    protected List _enum;

    public DateTimeProperty() {
        super.type = "string";
        super.format = "date-time";
    }

    public DateTimeProperty _enum(String value) {
        if (this._enum == null) {
            this._enum = new ArrayList();
        }
        if (!_enum.contains(value)) {
            _enum.add(value);
        }
        return this;
    }

    public DateTimeProperty _enum(List value) {
        this._enum = value;
        return this;
    }

    public static boolean isType(String type, String format) {
        if ("string".equals(type) && "date-time".equals(format)) {
            return true;
        } else {
            return false;
        }
    }

    public DateTimeProperty xml(Xml xml) {
        this.setXml(xml);
        return this;
    }

    public DateTimeProperty example(String example) {
        this.setExample(example);
        return this;
    }

    public DateTimeProperty vendorExtension(String key, Object obj) {
        this.setVendorExtension(key, obj);
        return this;
    }

    public List getEnum() {
        return _enum;
    }

    public void setEnum(List _enum) {
        this._enum = _enum;
    }

    public DateTimeProperty readOnly() {
        this.setReadOnly(Boolean.TRUE);
        return this;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy