Example usage for java.util Collections unmodifiableList

List of usage examples for java.util Collections unmodifiableList

Introduction

In this page you can find the example usage for java.util Collections unmodifiableList.

Prototype

public static <T> List<T> unmodifiableList(List<? extends T> list) 

Source Link

Document

Returns an unmodifiable view of the specified list.

Usage

From source file:com.willowtreeapps.androidcontentprovidergenerator.model.Entity.java

public List<String> getQueryParams() {
    return Collections.unmodifiableList(mQueryParams);
}

From source file:com.buffalokiwi.aerodrome.jet.JetException.java

public JetException(List<String> messages, Exception previous, IAPIResponse response) {
    super("Jet API Error Response", previous);
    if (messages != null)
        this.messages = Collections.unmodifiableList(messages);
    else//ww  w  .j  a v  a2 s .com
        this.messages = null;

    this.response = response;
}

From source file:com.kazuki43zoo.jpetstore.config.ApplicationConfig.java

@Bean
protected List<String> clCategories() {
    List<String> categoryList = new ArrayList<>();
    categoryList.add("FISH");
    categoryList.add("DOGS");
    categoryList.add("REPTILES");
    categoryList.add("CATS");
    categoryList.add("BIRDS");
    return Collections.unmodifiableList(categoryList);
}

From source file:test.parsing.CollectingReaderEventListener.java

public List<DefaultsDefinition> getDefaults() {
    return Collections.unmodifiableList(this.defaults);
}

From source file:hr.fer.spocc.regex.AbstractRegularExpression.java

public AbstractRegularExpression(Collection<RegularExpressionElement> c) throws IllegalArgumentException {
    Validate.isTrue(c != null && !c.isEmpty(), "Element list must be non-empty");

    this.elements = Collections.unmodifiableList(new ArrayList<RegularExpressionElement>(c));

    RegularExpression<T> root = createParseTree(elements);

    this.type = root.getType();
    if (root.isTrivial()) {
        this.operator = null;
        this.subexpression1 = null;
        this.subexpression2 = null;
    } else {//from   w  ww .j  a  v  a2  s . co m
        this.operator = root.getOperator();
        int arity = operator.getArity();
        this.subexpression1 = (arity > 0 ? root.getSubexpression(0) : null);
        this.subexpression2 = (arity > 1 ? root.getSubexpression(1) : null);
    }
}

From source file:net.sf.gazpachoquest.dto.SectionDTO.java

public List<QuestionDTO> getQuestions() {
    return Collections.unmodifiableList(questions);
}

From source file:com.zb.app.web.tools.EnumViewTools.java

public static List<LineTypeEnum> getAllLineType() {
    if (lineTypeEnumList == null) {
        lineTypeEnumList = new ArrayList<LineTypeEnum>();
        for (LineTypeEnum _enum : LineTypeEnum.values()) {
            lineTypeEnumList.add(_enum);
        }/*from www  .j av  a 2s.  co m*/
        lineTypeEnumList = Collections.unmodifiableList(lineTypeEnumList);
    }
    return lineTypeEnumList;
}

From source file:au.id.hazelwood.xmltvguidebuilder.model.ProgrammeDetail.java

public ProgrammeDetail(DateTime startDate, Minutes duration, String title, EpisodeDetail episodeDetail,
        List<String> categories, String rating) {
    Assert.notNull(startDate, "StartDate is required");
    Assert.notNull(duration, "Duration is required");
    this.startDate = startDate;
    this.duration = duration;
    this.endDate = startDate.plus(duration);
    this.title = title;
    this.episodeDetail = episodeDetail;
    this.categories = Collections.unmodifiableList(categories);
    this.rating = rating;
}

From source file:ca.uhn.fhir.validation.ValidationResult.java

public List<SingleValidationMessage> getMessages() {
    return Collections.unmodifiableList(myMessages);
}

From source file:com.serotonin.m2m2.util.license.InstanceLicense.java

public InstanceLicense(Document doc) throws LicenseParseException {
    Element licenseElement = doc.getDocumentElement();
    if (licenseElement == null || !StringUtils.equals("license", licenseElement.getTagName()))
        throw new LicenseParseException("Root element must be 'license'");

    Element coreElement = XmlUtilsTS.getChildElement(licenseElement, "core");
    if (coreElement == null)
        throw new LicenseParseException("Missing core element");

    guid = XmlUtilsTS.getChildElementText(coreElement, "guid");

    distributor = XmlUtilsTS.getChildElementText(coreElement, "distributor");
    version = XmlUtilsTS.getChildElementTextAsInt(coreElement, "version", -1);
    licenseType = XmlUtilsTS.getChildElementText(coreElement, "licenseType");

    Element featuresElement = XmlUtilsTS.getChildElement(coreElement, "features");
    List<LicenseFeature> featureList = new ArrayList<LicenseFeature>();
    if (featuresElement != null) {
        for (Element feature : XmlUtilsTS.getChildElements(featuresElement))
            featureList.add(new LicenseFeature(feature));
    }//  w  w w .j  a va  2 s .com
    features = Collections.unmodifiableList(featureList);

    Element modulesElement = XmlUtilsTS.getChildElement(licenseElement, "modules");
    List<ModuleLicense> moduleList = new ArrayList<ModuleLicense>();
    if (modulesElement != null) {
        for (Element module : XmlUtilsTS.getChildElements(modulesElement))
            moduleList.add(new ModuleLicense(module));
    }
    modules = Collections.unmodifiableList(moduleList);
}