List of usage examples for com.google.common.collect Iterables size
public static int size(Iterable<?> iterable)
From source file:org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneAndId.java
public static ZoneAndId fromSlashEncoded(String id) { Iterable<String> parts = Splitter.on('/').split(checkNotNull(id, "id")); checkArgument(Iterables.size(parts) == 2, "id must be in format zoneId/id"); return new ZoneAndId(Iterables.get(parts, 0), Iterables.get(parts, 1)); }
From source file:org.jclouds.joyent.sdc.v6_5.domain.datacenterscoped.DatacenterAndId.java
public static DatacenterAndId fromSlashEncoded(String id) { Iterable<String> parts = Splitter.on('/').split(checkNotNull(id, "id")); checkArgument(Iterables.size(parts) == 2, "id must be in format datacenterId/id"); return new DatacenterAndId(Iterables.get(parts, 0), Iterables.get(parts, 1)); }
From source file:org.apache.jclouds.profitbricks.rest.domain.zonescoped.DataCenterAndId.java
public static DataCenterAndId fromSlashEncoded(String id) { Iterable<String> parts = Splitter.on('/').split(checkNotNull(id, "id")); checkArgument(Iterables.size(parts) == 2, "id must be in format dataCenterId/id"); return new DataCenterAndId(Iterables.get(parts, 0), Iterables.get(parts, 1)); }
From source file:org.jclouds.azurecompute.arm.domain.RegionAndId.java
public static RegionAndId fromSlashEncoded(String id) { Iterable<String> parts = Splitter.on('/').split(checkNotNull(id, "id")); checkArgument(Iterables.size(parts) == 2, "id must be in format regionId/id"); return new AutoValue_RegionAndId(Iterables.get(parts, 0), Iterables.get(parts, 1)); }
From source file:suneido.database.immudb.IndexInfo.java
private static int[] convertColumns(String s) { Iterable<String> cs = commaSplitter(s); int[] cols = new int[Iterables.size(cs)]; int c = 0;//from ww w . ja v a 2 s. co m for (String col : cs) cols[c++] = Integer.parseInt(col); return cols; }
From source file:org.jclouds.azurecompute.arm.compute.domain.LocationAndName.java
public static LocationAndName fromSlashEncoded(String id) { Iterable<String> parts = Splitter.on('/').split(checkNotNull(id, "id")); checkArgument(Iterables.size(parts) == 2, "id must be in format location/name"); return new AutoValue_LocationAndName(Iterables.get(parts, 0), Iterables.get(parts, 1)); }
From source file:org.jclouds.azurecompute.arm.compute.domain.ResourceGroupAndName.java
public static ResourceGroupAndName fromSlashEncoded(String id) { Iterable<String> parts = Splitter.on('/').split(checkNotNull(id, "id")); checkArgument(Iterables.size(parts) == 2, "id must be in format resourcegroup/name"); return new AutoValue_ResourceGroupAndName(Iterables.get(parts, 0), Iterables.get(parts, 1)); }
From source file:org.jclouds.aliyun.ecs.domain.regionscoped.RegionAndId.java
public static RegionAndId fromSlashEncoded(String id) { Iterable<String> parts = Splitter.on('/').split(checkNotNull(id, "id")); checkArgument(Iterables.size(parts) == 2, "id must be in format regionId/id"); return RegionAndId.create(Iterables.get(parts, 0), Iterables.get(parts, 1)); }
From source file:me.taylorkelly.mywarp.util.IterableUtils.java
/** * Returns whether the given Iterable contains has least the given number of entries. * * @param <T> the type of entries * @param iterable the iterable to check * @param count the number of entries the iterable should have at least * @return true if the given Iterable has at least the given number of entries *//* www . ja v a 2 s.com*/ public static <T> boolean atLeast(Iterable<T> iterable, int count) { return Iterables.size(Iterables.limit(iterable, count)) == count; }
From source file:org.jclouds.googlecomputeengine.compute.domain.internal.RegionAndName.java
public static RegionAndName fromSlashEncoded(String name) { Iterable<String> parts = Splitter.on('/').split(checkNotNull(name, "name")); checkArgument(Iterables.size(parts) == 2, "name must be in format regionId/name"); return fromRegionAndName(Iterables.get(parts, 0), Iterables.get(parts, 1)); }