-
Notifications
You must be signed in to change notification settings - Fork 587
/
Lists.java
58 lines (54 loc) · 2.17 KB
/
Lists.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright (c) 2017 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*/
package org.eclipse.collections.api.factory;
import org.eclipse.collections.api.factory.list.FixedSizeListFactory;
import org.eclipse.collections.api.factory.list.ImmutableListFactory;
import org.eclipse.collections.api.factory.list.MutableListFactory;
/**
* This class should be used to create instances of MutableList, ImmutableList and FixedSizeList
* <p>
* Mutable Examples:
*
* <pre>
* MutableList<String> emptyList = Lists.mutable.empty();
* MutableList<String> listWith = Lists.mutable.with("a", "b", "c");
* MutableList<String> listOf = Lists.mutable.of("a", "b", "c");
* </pre>
*
* Immutable Examples:
*
* <pre>
* ImmutableList<String> emptyList = Lists.immutable.empty();
* ImmutableList<String> listWith = Lists.immutable.with("a", "b", "c");
* ImmutableList<String> listOf = Lists.immutable.of("a", "b", "c");
* </pre>
*
* FixedSize Examples:
*
* <pre>
* FixedSizeList<String> emptyList = Lists.fixedSize.empty();
* FixedSizeList<String> listWith = Lists.fixedSize.with("a", "b", "c");
* FixedSizeList<String> listOf = Lists.fixedSize.of("a", "b", "c");
* </pre>
*/
@SuppressWarnings("ConstantNamingConvention")
public final class Lists
{
public static final ImmutableListFactory immutable =
ServiceLoaderUtils.loadServiceClass(ImmutableListFactory.class);
public static final MutableListFactory mutable =
ServiceLoaderUtils.loadServiceClass(MutableListFactory.class);
public static final FixedSizeListFactory fixedSize =
ServiceLoaderUtils.loadServiceClass(FixedSizeListFactory.class);
private Lists()
{
throw new AssertionError("Suppress default constructor for noninstantiability");
}
}