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:eu.codesketch.adam.rest.domain.model.Image.java

public List<String> getRepoTags() {
    return Collections.unmodifiableList(repoTags);
}

From source file:io.netty.handler.codec.mqtt.MqttSubAckPayload.java

public MqttSubAckPayload(Iterable<MqttGrantedQoS> grantedQoSLevels) {
    if (grantedQoSLevels == null) {
        throw new IllegalArgumentException("Empty grantedQoSLevels");
    }/*from  ww  w .  j av  a2s  .com*/
    List<MqttGrantedQoS> list = new ArrayList<>();
    for (MqttGrantedQoS v : grantedQoSLevels) {
        if (v == null) {
            continue;
        }
        list.add(v);
    }
    this.grantedQoSLevels = Collections.unmodifiableList(list);
}

From source file:com.aqnote.app.wifianalyzer.wifi.band.Country.java

public List<Locale> getCountries() {
    return Collections.unmodifiableList(countries);
}

From source file:com.offbynull.peernetic.debug.visualizer.TriggerOnLingeringNodeCommand.java

/**
 * Constructs a {@link TriggerOnLingeringNodeCommand} object.
 * @param node node//from   w  w w  .java 2s. c  o  m
 * @param triggerCommand commands to trigger
 * @throws NullPointerException if any arguments are {@code null} or contain {@code null}
 */
public TriggerOnLingeringNodeCommand(A node, Command<A>... triggerCommand) {
    Validate.notNull(node);
    Validate.noNullElements(triggerCommand);

    this.node = node;
    this.triggerCommand = Collections.unmodifiableList(new ArrayList<>(Arrays.asList(triggerCommand)));
}

From source file:cf.component.Varz.java

public Varz(@JsonProperty("type") String type, @JsonProperty("index") Integer index,
        @JsonProperty("uuid") String uuid, @JsonProperty("host") String host,
        @JsonProperty("credentials") List<String> credentials, @JsonProperty("start") String start,
        @JsonProperty("uptime") String uptime, @JsonProperty("num_cores") int numCores,
        @JsonProperty("mem") long memory, @JsonProperty("cpu") float cpuUtilzation) {
    this.type = type;
    this.index = index;
    this.uuid = uuid;
    this.host = host;
    this.credentials = Collections.unmodifiableList(new ArrayList<String>(credentials));
    this.start = start;
    this.uptime = uptime;
    this.numCores = numCores;
    this.memory = memory;
    this.cpuUtilzation = cpuUtilzation;
}

From source file:com.rabidgremlin.legalbeagle.report.ReportItem.java

public List<String> getLicenses() {
    return Collections.unmodifiableList(licenses);
}

From source file:org.powertac.wpgenco.WindForecast.java

public List<Double> getTemperature() {
    return Collections.unmodifiableList(temperature);
}

From source file:de.codesourcery.eve.skills.production.OreRefiningData.java

public static List<String> getMineralNames() {
    return Collections.unmodifiableList(MINERAL_NAMES);
}

From source file:Main.java

/**
 * <p>Obtains the list of locales to search through when performing
 * a locale search.</p>//from w  ww . java 2 s  .  c  o m
 *
 * <pre>
 * localeLookupList(Locale("fr", "CA", "xxx"), Locale("en"))
 *   = [Locale("fr","CA","xxx"), Locale("fr","CA"), Locale("fr"), Locale("en"]
 * </pre>
 *
 * <p>The result list begins with the most specific locale, then the
 * next more general and so on, finishing with the default locale.
 * The list will never contain the same locale twice.</p>
 *
 * @param locale  the locale to start from, null returns empty list
 * @param defaultLocale  the default locale to use if no other is found
 * @return the unmodifiable list of Locale objects, 0 being locale, not null
 */
public static List<Locale> localeLookupList(Locale locale, Locale defaultLocale) {
    List<Locale> list = new ArrayList<Locale>(4);
    if (locale != null) {
        list.add(locale);
        if (locale.getVariant().length() > 0) {
            list.add(new Locale(locale.getLanguage(), locale.getCountry()));
        }
        if (locale.getCountry().length() > 0) {
            list.add(new Locale(locale.getLanguage(), ""));
        }
        if (!list.contains(defaultLocale)) {
            list.add(defaultLocale);
        }
    }
    return Collections.unmodifiableList(list);
}

From source file:org.sunnycode.schema.Schema.java

@JsonCreator
public Schema(@JsonProperty("attributes") List<Attribute> attributes) {
    if (attributes == null) {
        throw new IllegalArgumentException("'attributes' must be present");
    }/* w ww . java2  s  . co  m*/

    this.attributes = Collections.unmodifiableList(attributes);

    Map<String, Attribute> newAttributes = new LinkedHashMap<String, Attribute>();
    for (Attribute attr : attributes) {
        newAttributes.put(attr.getName(), attr);
    }

    this.attributeMap = Collections.unmodifiableMap(newAttributes);
}