List of usage examples for java.util Collections singletonList
public static <T> List<T> singletonList(T o)
From source file:Main.java
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) private static List<Camera.Area> buildMiddleArea(int areaPer1000) { return Collections .singletonList(new Camera.Area(new Rect(-areaPer1000, -areaPer1000, areaPer1000, areaPer1000), 1)); }
From source file:com.github.robozonky.integrations.stonky.Util.java
public static com.google.api.services.drive.model.File copyFile(final Drive driveService, final com.google.api.services.drive.model.File upstream, final com.google.api.services.drive.model.File parent, final String name) throws IOException { LOGGER.debug("Cloning master spreadsheet '{}', setting name: {}.", upstream.getId(), name); final com.google.api.services.drive.model.File f = new com.google.api.services.drive.model.File(); f.setName(name);//from w w w . ja va 2s.c om f.setParents(Collections.singletonList(parent.getId())); final com.google.api.services.drive.model.File result = driveService.files().copy(upstream.getId(), f) .setFields("id,name,modifiedTime").execute(); LOGGER.debug("Created a copy: {}.", result.getId()); return result; }
From source file:org.springframework.hateoas.hal.ResourceMappingJackson2HttpMessageConverter.java
/** * Construct a new {@code ResourceMappingJackson2HttpMessageConverter} with a * customized {@link ObjectMapper} to support HAL resources. *//*from w w w .jav a 2s. c o m*/ public ResourceMappingJackson2HttpMessageConverter() { super(Resource.class); super.setSupportedMediaTypes( Collections.singletonList(new MediaType("application", "hal+json", DEFAULT_CHARSET))); ObjectMapper objectMapper = getObjectMapper(); objectMapper.registerModule(new Jackson2HalModule()); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); super.setObjectMapper(objectMapper); }
From source file:eu.over9000.cathode.data.parameters.GetFollowsSortBy.java
@Override public List<NameValuePair> buildParamPairs() { if (sortby == null) { return Collections.emptyList(); }/*from w w w . j av a 2 s . co m*/ return Collections.singletonList(new BasicNameValuePair("sortby", sortby.name())); }
From source file:devbury.dewey.hipchat.api.ApiTest.java
@Test public void intercept() throws IOException { HipChatSettings hipChatSettings = new HipChatSettings(); hipChatSettings.setApiToken("TOKEN"); Api api = new Api(); api.setHipChatSettings(hipChatSettings); api.init();//ww w . ja va2 s. c om api.intercept(httpRequest, null, (request, body) -> null); new Verifications() { { restTemplate.setInterceptors(Collections.singletonList(api)); httpRequest.getHeaders().add("Authorization", "Bearer TOKEN"); } }; }
From source file:eu.over9000.cathode.data.parameters.StreamTypeOption.java
@Override public List<NameValuePair> buildParamPairs() { if (streamType == null) { return Collections.emptyList(); }//w w w . j av a2s. com return Collections.singletonList(new BasicNameValuePair("stream_type", streamType.name())); }
From source file:de.jackwhite20.japs.client.pub.impl.PublisherImpl.java
public PublisherImpl(String host, int port) { this(Collections.singletonList(new ClusterServer(host, port))); }
From source file:org.juiser.spring.boot.config.ForwardedUserFilterConfig.java
public ForwardedUserFilterConfig() { this.enabled = true; this.matchAfter = false; this.order = 10; this.dispatcherTypes = new LinkedHashSet<>(Arrays.asList(DispatcherType.values())); this.requestAttributeNames = new LinkedHashSet<>(Collections.singletonList("user")); this.servletNames = new LinkedHashSet<>(); this.urlPatterns = new LinkedHashSet<>(Collections.singletonList(DEFAULT_URL_PATTERN)); }
From source file:io.fluo.stress.TrieBasicIT.java
@Override protected List<ObserverConfiguration> getObservers() { return Collections.singletonList(new ObserverConfiguration(NodeObserver.class.getName())); }
From source file:me.smoe.adar.zookeeper.zookeeper.Zookeeper.java
public static void authForRoot(ZooKeeper zooKeeper) throws NoSuchAlgorithmException, KeeperException, InterruptedException { ACL acl = new ACL(Perms.ALL, new Id("digest", DigestAuthenticationProvider.generateDigest("admin:admin"))); zooKeeper.setACL("/", Collections.singletonList(acl), -1); }