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:net.dv8tion.jda.core.entities.impl.MemberImpl.java

@Override
public List<Permission> getPermissions() {
    return Collections
            .unmodifiableList(Permission.getPermissions(PermissionUtil.getEffectivePermission(guild, this)));
}

From source file:net.sf.jabref.model.entry.CustomEntryType.java

@Override
public List<String> getRequiredFields() {
    return Collections.unmodifiableList(required);
}

From source file:com.ciphertool.zodiacengine.entities.WordGene.java

@Override
public List<Sequence> getSequences() {
    return Collections.unmodifiableList(this.sequences);
}

From source file:forge.card.mana.ManaCost.java

private void sealClass(List<ManaCostShard> shards0) {
    this.shards = Collections.unmodifiableList(shards0);
    this.stringValue = this.getSimpleString();
}

From source file:com.cognifide.qa.bb.aem.core.component.configuration.ComponentConfiguration.java

/**
 * @return Tabs described in the configuration
 */
public List<TabConfig> getTabs() {
    return Collections.unmodifiableList(data);
}

From source file:com.jaxio.celerio.template.pack.ClasspathResourceUncryptedPack.java

@Override
public List<String> getTemplateNames() {
    return Collections.unmodifiableList(templateNames);
}

From source file:com.ait.tooling.server.core.servlet.filter.HeaderInjectorFilter.java

public final List<IHeaderInjector> getInjectors() {
    return Collections.unmodifiableList(m_injectors);
}

From source file:org.maodian.flyingcat.im.entity.Account.java

public List<SimpleUser> getContactList() {
    return Collections.unmodifiableList(contacts);
}

From source file:com.clustercontrol.selfcheck.monitor.AsyncTaskQueueMonitor.java

/**
 * ???????//from  w ww.j a v a 2 s  .co  m
 * @return 
 */
@Override
public void execute() {
    if (!HinemosPropertyUtil.getHinemosPropertyBool("selfcheck.monitoring.asynctask.queue", true)) {
        m_log.debug("skip");
        return;
    }

    /**  */
    String asyncTaskRaw = HinemosPropertyUtil.getHinemosPropertyStr("selfcheck.monitoring.asynctask.queue.list",
            "NotifyStatusTaskFactory:10000,NotifyEventTaskFactory:10000,NotifyMailTaskFactory:10000,NotifyCommandTaskFactory:10000,NotifyLogEscalationTaskFactory:10000,NotifyJobTaskFactory:10000,CreateJobSessionTaskFactory:100,NotifyInfraTaskFactory:10000");
    List<AsyncTaskQueueConfig> asyncTasks = new ArrayList<AsyncTaskQueueConfig>();
    for (String task : asyncTaskRaw.split(",")) {
        String[] pair = task.split(":");
        if (pair.length == 2) {
            asyncTasks.add(new AsyncTaskQueueConfig(pair[0], Integer.parseInt(pair[1])));
        }
    }
    List<AsyncTaskQueueConfig> asyncTaskList = Collections.unmodifiableList(asyncTasks);
    for (AsyncTaskQueueConfig config : asyncTaskList) {
        String worker = config.worker;
        int threshold = config.queueThreshold;

        int queueSize = 0;
        boolean warn = true;
        String subKey = worker;

        /** ? */
        try {
            queueSize = getTaskCount(worker);
        } catch (Exception e) {
            m_log.warn("access failure to async worker plugin. (worker = " + worker + ")");
        }
        if (queueSize <= threshold) {
            m_log.debug("asynchronous task queue is normal. (worker = " + worker + ", queueSize = " + queueSize
                    + ")");
            warn = false;
        }

        if (warn) {
            m_log.info("asynchronous task queue is too large. (worker = " + worker + ", queueSize = "
                    + queueSize + ")");
        }

        if (!isNotify(subKey, warn)) {
            return;
        }
        String[] msgAttr1 = { Integer.toString(queueSize), Integer.toString(threshold) };
        AplLogger.put(PriorityConstant.TYPE_WARNING, PLUGIN_ID, MessageConstant.MESSAGE_SYS_011_SYS_SFC,
                msgAttr1, "too many asynchronous task in Hinemos Manager. (queued task " + queueSize
                        + " > threshold " + threshold + ")");
    }

    return;
}

From source file:com.optimizely.ab.config.Experiment.java

public Experiment(String id, String key, String status, List<String> audienceIds, List<Variation> variations,
        Map<String, String> userIdToVariationKeyMap, List<TrafficAllocation> trafficAllocation,
        String groupId) {/*www .  j  av a2 s  .  c  om*/
    this.id = id;
    this.key = key;
    this.status = status;
    this.audienceIds = Collections.unmodifiableList(audienceIds);
    this.variations = Collections.unmodifiableList(variations);
    this.trafficAllocation = Collections.unmodifiableList(trafficAllocation);
    this.groupId = groupId;
    this.userIdToVariationKeyMap = userIdToVariationKeyMap;
    this.variationKeyToVariationMap = ProjectConfigUtils.generateNameMapping(variations);
    this.variationIdToVariationMap = ProjectConfigUtils.generateIdMapping(variations);
}