@Test public void testSelector() { String selector = Helper.selector(REQUIRED_FIELDS, FIELD3); assertTrue(selector.contains("field1")); assertTrue(selector.contains("field2")); assertTrue(selector.contains("field3")); assertEquals(20, selector.length()); }
/** * Returns an option to specify the bucket's fields to be returned by the RPC call. If this * option is not provided all bucket's fields are returned. {@code BucketGetOption.fields}) can * be used to specify only the fields of interest. Bucket name is always returned, even if not * specified. */ public static BucketGetOption fields(BucketField... fields) { return new BucketGetOption( StorageRpc.Option.FIELDS, Helper.selector(BucketField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the dataset's fields to be returned by the RPC call. If this * option is not provided all dataset's fields are returned. {@code DatasetOption.fields} can be * used to specify only the fields of interest. {@link Dataset#getDatasetId()} is always * returned, even if not specified. */ public static DatasetOption fields(DatasetField... fields) { return new DatasetOption( BigQueryRpc.Option.FIELDS, Helper.selector(DatasetField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the license's fields to be returned by the RPC call. If this * option is not provided, all license's fields are returned. {@code LicenseOption.fields} can * be used to specify only the fields of interest. {@link License#getLicenseId()} is always * returned, even if not specified. */ public static LicenseOption fields(LicenseField... fields) { return new LicenseOption( ComputeRpc.Option.FIELDS, Helper.selector(LicenseField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the disk's fields to be returned by the RPC call. If this option * is not provided, all disk's fields are returned. {@code DiskOption.fields} can be used to * specify only the fields of interest. {@link Disk#getDiskId()}, {@link * DiskConfiguration#getDiskType()} and either {@link * SnapshotDiskConfiguration#getSourceSnapshot()} or {@link * ImageDiskConfiguration#getSourceImage()} are always returned, even if not specified. */ public static DiskOption fields(DiskField... fields) { return new DiskOption( ComputeRpc.Option.FIELDS, Helper.selector(DiskField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the snapshot's fields to be returned by the RPC call. If this * option is not provided, all the snapshot's fields are returned. {@code SnapshotOption.fields} * can be used to specify only the fields of interest. {@link Snapshot#getSnapshotId()} is * always returned, even if not specified. */ public static SnapshotOption fields(SnapshotField... fields) { return new SnapshotOption( ComputeRpc.Option.FIELDS, Helper.selector(SnapshotField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the region's fields to be returned by the RPC call. If this * option is not provided, all region's fields are returned. {@code RegionOption.fields} can be * used to specify only the fields of interest. {@link Region#getRegionId()} is always returned, * even if not specified. */ public static RegionOption fields(RegionField... fields) { return new RegionOption( ComputeRpc.Option.FIELDS, Helper.selector(RegionField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the machine type's fields to be returned by the RPC call. If * this option is not provided, all machine type's fields are returned. {@code * MachineTypeOption.fields} can be used to specify only the fields of interest. {@link * MachineType#getMachineTypeId()} is always returned, even if not specified. */ public static MachineTypeOption fields(MachineTypeField... fields) { return new MachineTypeOption( ComputeRpc.Option.FIELDS, Helper.selector(MachineTypeField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the blob's fields to be returned by the RPC call. If this option * is not provided all blob's fields are returned. {@code BlobGetOption.fields}) can be used to * specify only the fields of interest. Blob name and bucket are always returned, even if not * specified. */ public static BlobGetOption fields(BlobField... fields) { return new BlobGetOption( StorageRpc.Option.FIELDS, Helper.selector(BlobField.REQUIRED_FIELDS, fields)); }
/** * Returns an option to specify the zones's fields to be returned by the RPC call. * * <p>If this option is not provided all zone fields are returned. {@code ZoneOption.fields} can * be used to specify only the fields of interest. Zone ID is always returned, even if not * specified. {@link ZoneField} provides a list of fields that can be used. */ public static ZoneOption fields(ZoneField... fields) { return new ZoneOption( DnsRpc.Option.FIELDS, Helper.selector(ZoneField.REQUIRED_FIELDS, fields)); } }
/** * Returns a composite selector given a number of resource fields and a container name. The * string selector returned by this method can be used for field selection in API calls that * return a list of resources. This method is not supposed to be used directly by users. */ public static String listSelector( String containerName, List<? extends FieldSelector> required, FieldSelector... others) { return "nextPageToken," + containerName + '(' + selector(required, others) + ')'; }
/** * Returns an option to specify the image's fields to be returned by the RPC call. If this * option is not provided, all image's fields are returned. {@code ImageOption.fields} can be * used to specify only the fields of interest. {@link Image#getImageId()} and {@link * Image#getConfiguration()} are always returned, even if not specified. */ public static ImageOption fields(ImageField... fields) { return new ImageOption( ComputeRpc.Option.FIELDS, Helper.selector(ImageField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the zone's fields to be returned by the RPC call. If this option * is not provided, all zone's fields are returned. {@code ZoneOption.fields} can be used to * specify only the fields of interest. {@link Zone#getZoneId()} is always returned, even if not * specified. */ public static ZoneOption fields(ZoneField... fields) { return new ZoneOption( ComputeRpc.Option.FIELDS, Helper.selector(ZoneField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the disk type's fields to be returned by the RPC call. If this * option is not provided, all disk type's fields are returned. {@code DiskTypeOption.fields} * can be used to specify only the fields of interest. {@link DiskType#getDiskTypeId()} is * always returned, even if not specified. */ public static DiskTypeOption fields(DiskTypeField... fields) { return new DiskTypeOption( ComputeRpc.Option.FIELDS, Helper.selector(DiskTypeField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the table's fields to be returned by the RPC call. If this * option is not provided all table's fields are returned. {@code TableOption.fields} can be * used to specify only the fields of interest. {@link Table#getTableId()} and type (which is * part of {@link Table#getDefinition()}) are always returned, even if not specified. */ public static TableOption fields(TableField... fields) { return new TableOption( BigQueryRpc.Option.FIELDS, Helper.selector(TableField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the instance's fields to be returned by the RPC call. If this * option is not provided, all instance's fields are returned. {@code InstanceOption.fields} can * be used to specify only the fields of interest. {@link Instance#getInstanceId()} is always * returned, even if not specified. */ public static InstanceOption fields(InstanceField... fields) { return new InstanceOption( ComputeRpc.Option.FIELDS, Helper.selector(InstanceField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the address' fields to be returned by the RPC call. If this * option is not provided, all address' fields are returned. {@code AddressOption.fields} can be * used to specify only the fields of interest. {@link Address#getAddressId()} is always * returned, even if not specified. */ public static AddressOption fields(AddressField... fields) { return new AddressOption( ComputeRpc.Option.FIELDS, Helper.selector(AddressField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the job's fields to be returned by the RPC call. If this option * is not provided all job's fields are returned. {@code JobOption.fields()} can be used to * specify only the fields of interest. {@link Job#getJobId()} as well as type-specific * configuration (e.g. {@link QueryJobConfiguration#getQuery()} for Query Jobs) are always * returned, even if not specified. */ public static JobOption fields(JobField... fields) { return new JobOption( BigQueryRpc.Option.FIELDS, Helper.selector(JobField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the network's fields to be returned by the RPC call. If this * option is not provided, all network's fields are returned. {@code NetworkOption.fields} can * be used to specify only the fields of interest. {@link Network#getNetworkId()} and {@link * Network#getConfiguration()} are always returned, even if not specified. */ public static NetworkOption fields(NetworkField... fields) { return new NetworkOption( ComputeRpc.Option.FIELDS, Helper.selector(NetworkField.REQUIRED_FIELDS, fields)); } }
/** * Returns an option to specify the subnetwork's fields to be returned by the RPC call. If this * option is not provided, all subnetwork's fields are returned. {@code SubnetworkOption.fields} * can be used to specify only the fields of interest. {@link Subnetwork#getSubnetworkId()} is * always returned, even if not specified. */ public static SubnetworkOption fields(SubnetworkField... fields) { return new SubnetworkOption( ComputeRpc.Option.FIELDS, Helper.selector(SubnetworkField.REQUIRED_FIELDS, fields)); } }