Tabnine Logo
Collections.checkedList
Code IndexAdd Tabnine to your IDE (free)

How to use
checkedList
method
in
java.util.Collections

Best Java code snippets using java.util.Collections.checkedList (Showing top 20 results out of 432)

origin: google/guava

 @Override
 public List<String> create(String[] elements) {
  List<String> innerList = new ArrayList<>();
  Collections.addAll(innerList, elements);
  return Collections.checkedList(innerList, String.class);
 }
})
origin: stackoverflow.com

List<Integer> checkedList = Collections.checkedList(list, Integer.class);
origin: stackoverflow.com

List<Cat> cats = Collections.checkedList(q.list(), Cat.class);
origin: stackoverflow.com

 @SuppressWarnings("unchecked")
List<SyndEntry> entries = Collections.checkedList(sf.getEntries(), SyndEntry.class);
origin: wildfly/wildfly

public AttachmentList(final Class<T> valueClass) {
  delegate = Collections.checkedList(new ArrayList<T>(), valueClass);
  this.valueClass = valueClass;
}
origin: wildfly/wildfly

public AttachmentList(final int initialCapacity, final Class<T> valueClass) {
  delegate = Collections.checkedList(new ArrayList<T>(initialCapacity), valueClass);
  this.valueClass = valueClass;
}
origin: pmd/pmd

@Override
protected Collection<String> defaultSuppressionAnnotations() {
  return Collections.checkedList(Arrays.asList("java.lang.Override"), String.class);
}
origin: robovm/robovm

@Override public List<E> subList(int fromIndex, int toIndex) {
  return checkedList(l.subList(fromIndex, toIndex), type);
}
origin: wildfly/wildfly

public AttachmentList(final Collection<? extends T> c, final Class<T> valueClass) {
  delegate = Collections.checkedList(new ArrayList<T>(c.size()), valueClass);
  delegate.addAll(c);
  this.valueClass = valueClass;
}
origin: wildfly/wildfly

classes.add(Collections.checkedList(randomAccessList, Void.class).getClass());
classes.add(Collections.checkedList(nonRandomAccessList, Void.class).getClass());
classes.add(Collections.checkedMap(Collections.emptyMap(), Void.class, Void.class).getClass());
classes.add(Collections.checkedNavigableMap(Collections.emptyNavigableMap(), Void.class, Void.class).getClass());
origin: protostuff/protostuff

checkedSet = Collections.checkedSet(es, Size.class);
checkedSortedSet = Collections.checkedSortedSet(ts, String.class);
checkedList = Collections.checkedList(ll, String.class);
checkedRandomAccessList = Collections.checkedList(newList("nine"),
    String.class);
origin: stackoverflow.com

List<Integer> checked = Collections.checkedList(list, Integer.class);
origin: stackoverflow.com

Collections.checkedList(
  new ArrayList<String>(uncertainList.size()), String.class)
  .addAll(uncertainList);
origin: stackoverflow.com

 <T extends Super> List<T> myMethod(final Class<T> clazz) {
  final List<T> ret = Collections.checkedList(new ArrayList<T>(), clazz);
  // ... add elements to ret ...
  return ret;
}
origin: stackoverflow.com

 public <T extends Resource> List<T> getResources(Class<T> resourceType, String path)
{
  ResourcesResponse rgRes = new ObjectMapper()
  .readValue(response.body().byteStream(), ResourcesResponse.class)

  return Collections.checkedList(rgRes.resources, resourceType);
}
origin: com.google.guava/guava-testlib

 @Override
 public List<String> create(String[] elements) {
  List<String> innerList = new ArrayList<>();
  Collections.addAll(innerList, elements);
  return Collections.checkedList(innerList, String.class);
 }
})
origin: stackoverflow.com

 class Test<T> {
  List<T> l;

  public Test(Class<T> c) {
    l = Collections.checkedList(new ArrayList<T>(), c);
  }

  public void add(Object o) {
    l.add((T) o);
  }
}
origin: io.undertow/undertow-core

public AttachmentList(final Collection<? extends T> c, final Class<T> valueClass) {
  delegate = Collections.checkedList(new ArrayList<T>(c.size()), valueClass);
  delegate.addAll(c);
  this.valueClass = valueClass;
}
origin: org.wildfly.core/wildfly-server

public AttachmentList(final Collection<? extends T> c, final Class<T> valueClass) {
  delegate = Collections.checkedList(new ArrayList<T>(c.size()), valueClass);
  delegate.addAll(c);
  this.valueClass = valueClass;
}
origin: org.jboss.as/jboss-as-server

public AttachmentList(final Collection<? extends T> c, final Class<T> valueClass) {
  delegate = Collections.checkedList(new ArrayList<T>(c.size()), valueClass);
  delegate.addAll(c);
  this.valueClass = valueClass;
}
java.utilCollectionscheckedList

Javadoc

Returns a dynamically typesafe view of the specified list. Trying to insert an element of the wrong type into this list throws a ClassCastException. At creation time the types in listare not checked for correct type.

Popular methods of Collections

  • emptyList
    Returns the empty list (immutable). This list is serializable.This example illustrates the type-safe
  • sort
  • singletonList
    Returns an immutable list containing only the specified object. The returned list is serializable.
  • unmodifiableList
    Returns an unmodifiable view of the specified list. This method allows modules to provide users with
  • emptyMap
    Returns the empty map (immutable). This map is serializable.This example illustrates the type-safe w
  • emptySet
    Returns the empty set (immutable). This set is serializable. Unlike the like-named field, this metho
  • unmodifiableMap
    Returns an unmodifiable view of the specified map. This method allows modules to provide users with
  • singleton
    Returns an immutable set containing only the specified object. The returned set is serializable.
  • unmodifiableSet
    Returns an unmodifiable view of the specified set. This method allows modules to provide users with
  • singletonMap
    Returns an immutable map, mapping only the specified key to the specified value. The returned map is
  • addAll
    Adds all of the specified elements to the specified collection. Elements to be added may be specifie
  • reverse
    Reverses the order of the elements in the specified list. This method runs in linear time.
  • addAll,
  • reverse,
  • unmodifiableCollection,
  • shuffle,
  • enumeration,
  • list,
  • synchronizedMap,
  • synchronizedList,
  • reverseOrder,
  • emptyIterator

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now