repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
yyxhdy/ManyEAs
src/jmetal/core/Problem.java
// Path: src/jmetal/util/JMException.java // public class JMException extends Exception implements Serializable { // // /** // * Constructor // * @param Error message // */ // public JMException (String message){ // super(message); // } // JmetalException // }
import java.io.Serializable; import jmetal.util.JMException;
} // getNumberOfObjectives /** * Gets the lower bound of the ith encodings.variable of the problem. * * @param i * The index of the encodings.variable. * @return The lower bound. */ public double getLowerLimit(int i) { return lowerLimit_[i]; } // getLowerLimit /** * Gets the upper bou...
// Path: src/jmetal/util/JMException.java // public class JMException extends Exception implements Serializable { // // /** // * Constructor // * @param Error message // */ // public JMException (String message){ // super(message); // } // JmetalException // } // Path: src/jmetal/core/Pro...
public abstract void evaluate(Solution solution) throws JMException;
yyxhdy/ManyEAs
src/jmetal/encodings/variable/Real.java
// Path: src/jmetal/core/Variable.java // public abstract class Variable implements Serializable { // // /** // * Creates an exact copy of a <code>Variable</code> object. // * @return the copy of the object. // */ // public abstract Variable deepCopy(); // // /** // * Gets the double value represen...
import jmetal.util.Configuration; import jmetal.util.JMException; import jmetal.util.PseudoRandom; import jmetal.core.Variable;
public Real(Variable variable) throws JMException{ lowerBound_ = variable.getLowerBound(); upperBound_ = variable.getUpperBound(); value_ = variable.getValue(); } //Real /** * Gets the value of the <code>Real</code> encodings.variable. * @return the value. */ public double getValue...
// Path: src/jmetal/core/Variable.java // public abstract class Variable implements Serializable { // // /** // * Creates an exact copy of a <code>Variable</code> object. // * @return the copy of the object. // */ // public abstract Variable deepCopy(); // // /** // * Gets the double value represen...
Configuration.logger_.severe("Real.deepCopy.execute: JMException");
yyxhdy/ManyEAs
src/jmetal/core/Operator.java
// Path: src/jmetal/util/JMException.java // public class JMException extends Exception implements Serializable { // // /** // * Constructor // * @param Error message // */ // public JMException (String message){ // super(message); // } // JmetalException // }
import java.io.Serializable; import java.util.HashMap; import java.util.Map; import jmetal.util.JMException;
// Operator.java // // Authors: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public ...
// Path: src/jmetal/util/JMException.java // public class JMException extends Exception implements Serializable { // // /** // * Constructor // * @param Error message // */ // public JMException (String message){ // super(message); // } // JmetalException // } // Path: src/jmetal/core/Ope...
abstract public Object execute(Object object) throws JMException ;
yyxhdy/ManyEAs
src/jmetal/core/Algorithm.java
// Path: src/jmetal/util/JMException.java // public class JMException extends Exception implements Serializable { // // /** // * Constructor // * @param Error message // */ // public JMException (String message){ // super(message); // } // JmetalException // }
import jmetal.util.JMException; import java.io.Serializable; import java.util.HashMap; import java.util.Map;
// Algorithm.java // // Authors: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> //// // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Publ...
// Path: src/jmetal/util/JMException.java // public class JMException extends Exception implements Serializable { // // /** // * Constructor // * @param Error message // */ // public JMException (String message){ // super(message); // } // JmetalException // } // Path: src/jmetal/core/Alg...
public abstract SolutionSet execute() throws JMException,
yyxhdy/ManyEAs
src/jmetal/problems/WFG/Transformations.java
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
import jmetal.util.JMException; import jmetal.util.Configuration;
// Transformations.java // // Author: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Pu...
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
public float b_poly(float y, float alpha) throws JMException{
yyxhdy/ManyEAs
src/jmetal/problems/WFG/Transformations.java
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
import jmetal.util.JMException; import jmetal.util.Configuration;
// Transformations.java // // Author: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Pu...
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
Configuration.logger_.severe("WFG.Transformations.b_poly: Param alpha " +
yyxhdy/ManyEAs
src/jmetal/core/Variable.java
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
import jmetal.util.JMException; import java.io.Serializable; import jmetal.util.Configuration;
// SolutionType.java // // Author: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Publ...
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
public double getValue() throws JMException {
yyxhdy/ManyEAs
src/jmetal/core/Variable.java
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
import jmetal.util.JMException; import java.io.Serializable; import jmetal.util.Configuration;
// SolutionType.java // // Author: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Publ...
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
Configuration.logger_.severe("Class " + name + " does not implement " +
yyxhdy/ManyEAs
src/jmetal/operators/mutation/MutationFactory.java
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
import jmetal.util.JMException; import java.util.HashMap; import jmetal.util.Configuration;
// MutationFactory.java // // Author: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Pu...
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
throws JMException {
yyxhdy/ManyEAs
src/jmetal/operators/mutation/MutationFactory.java
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
import jmetal.util.JMException; import java.util.HashMap; import jmetal.util.Configuration;
// MutationFactory.java // // Author: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Pu...
// Path: src/jmetal/util/Configuration.java // public class Configuration implements Serializable { // // /** // * Logger object // */ // public static Logger logger_ = Logger.getLogger("jMetal"); // // } // Configuration // // Path: src/jmetal/util/JMException.java // public class JMException extend...
Configuration.logger_.severe("Operator '" + name + "' not found ");
yyxhdy/ManyEAs
src/jmetal/encodings/variable/BinaryReal.java
// Path: src/jmetal/core/Variable.java // public abstract class Variable implements Serializable { // // /** // * Creates an exact copy of a <code>Variable</code> object. // * @return the copy of the object. // */ // public abstract Variable deepCopy(); // // /** // * Gets the double value represen...
import jmetal.util.JMException; import java.util.BitSet; import jmetal.core.Variable;
double value = 0.0; for (int i = 0; i < numberOfBits_; i++) { if (bits_.get(i)) { value += Math.pow(2.0, i); } } value_ = value * (upperBound_ - lowerBound_) / (Math.pow(2.0, numberOfBits_) - 1.0); value_ += lowerBound_; } // decode /** * Returns the double value of the encodings.variable....
// Path: src/jmetal/core/Variable.java // public abstract class Variable implements Serializable { // // /** // * Creates an exact copy of a <code>Variable</code> object. // * @return the copy of the object. // */ // public abstract Variable deepCopy(); // // /** // * Gets the double value represen...
public void setValue(double value) throws JMException {
yyxhdy/ManyEAs
src/jmetal/encodings/variable/BinaryReal.java
// Path: src/jmetal/core/Variable.java // public abstract class Variable implements Serializable { // // /** // * Creates an exact copy of a <code>Variable</code> object. // * @return the copy of the object. // */ // public abstract Variable deepCopy(); // // /** // * Gets the double value represen...
import jmetal.util.JMException; import java.util.BitSet; import jmetal.core.Variable;
int ithPowerOf2 = (int) Math.pow(2, i); if (ithPowerOf2 <= remain) { // System.out // .println(ithPowerOf2thValue + " <= " + remain); bitSet.set(i); remain -= ithPowerOf2; } else { bitSet.clear(i); } } } this.bits_ = bitSet; this.decode(); } else { i...
// Path: src/jmetal/core/Variable.java // public abstract class Variable implements Serializable { // // /** // * Creates an exact copy of a <code>Variable</code> object. // * @return the copy of the object. // */ // public abstract Variable deepCopy(); // // /** // * Gets the double value represen...
public Variable deepCopy() {
briangormanly/4dflib
src/main/java/com/fdflib/util/FdfSettings.java
// Path: src/main/java/com/fdflib/persistence/database/DatabaseUtil.java // public class DatabaseUtil { // // private static org.slf4j.Logger fdfLog = LoggerFactory.getLogger(JdbcConnection.class); // // public enum DatabaseType { // MYSQL, POSTGRES, ORACLE, MSSQL, HSQL // } // // public enum...
import com.fdflib.persistence.database.DatabaseUtil; import com.sun.org.apache.xpath.internal.operations.Bool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; import java.util.concurrent.ThreadFactory;
/** * 4DFLib * Copyright (c) 2015-2016 Brian Gormanly * 4dflib.com * * 4DFLib is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 3 of the License, or (at your option) * any later ver...
// Path: src/main/java/com/fdflib/persistence/database/DatabaseUtil.java // public class DatabaseUtil { // // private static org.slf4j.Logger fdfLog = LoggerFactory.getLogger(JdbcConnection.class); // // public enum DatabaseType { // MYSQL, POSTGRES, ORACLE, MSSQL, HSQL // } // // public enum...
public static DatabaseUtil.DatabaseType PERSISTENCE = DatabaseUtil.DatabaseType.HSQL;
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/SearchTemplate.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/SearchOperations.java // public interface SearchOperations { // // /** // * Search among messages, users, tags and groups for the given string // * @param searchString // * @return search results potentially containing messages, u...
import org.springframework.social.yammer.api.SearchOperations; import org.springframework.social.yammer.api.SearchResults; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate;
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/SearchOperations.java // public interface SearchOperations { // // /** // * Search among messages, users, tags and groups for the given string // * @param searchString // * @return search results potentially containing messages, u...
public SearchResults search(String searchString){
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/json/GroupMixin.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Group.java // public static class GroupStats{ // private final int updates; // private final int members; // private final Date lastMessageAt; // private final long lastMessageId; // // public GroupStats(int updates, int...
import java.util.Date; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonDeserialize; import org.springframework.social.yammer.api.Group.GroupStats; import org.sprin...
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Group.java // public static class GroupStats{ // private final int updates; // private final int members; // private final Date lastMessageAt; // private final long lastMessageId; // // public GroupStats(int updates, int...
@JsonProperty("stats") GroupStats stats,
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/json/GroupMixin.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Group.java // public static class GroupStats{ // private final int updates; // private final int members; // private final Date lastMessageAt; // private final long lastMessageId; // // public GroupStats(int updates, int...
import java.util.Date; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonDeserialize; import org.springframework.social.yammer.api.Group.GroupStats; import org.sprin...
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Group.java // public static class GroupStats{ // private final int updates; // private final int members; // private final Date lastMessageAt; // private final long lastMessageId; // // public GroupStats(int updates, int...
@JsonProperty("created_at") @JsonDeserialize(using=YammerDateDeserializer.class) Date createdAt
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/json/YammerThreadMixin.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public class Topic { // // private String type; // private String webUrl; // private String normalizedName; // private List<TopicExpert> experts; // private String name; // private long id; // // public Topic(Strin...
import java.util.Date; import java.util.List; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonDeserialize; import org.springframework.social.yammer.api.Topic; impo...
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public class Topic { // // private String type; // private String webUrl; // private String normalizedName; // private List<TopicExpert> experts; // private String name; // private long id; // // public Topic(Strin...
@JsonProperty("stats") ThreadStats stats,
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/json/YammerThreadMixin.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public class Topic { // // private String type; // private String webUrl; // private String normalizedName; // private List<TopicExpert> experts; // private String name; // private long id; // // public Topic(Strin...
import java.util.Date; import java.util.List; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonDeserialize; import org.springframework.social.yammer.api.Topic; impo...
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public class Topic { // // private String type; // private String webUrl; // private String normalizedName; // private List<TopicExpert> experts; // private String name; // private long id; // // public Topic(Strin...
@JsonProperty("topics") List<Topic> topics
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/json/YammerThreadMixin.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public class Topic { // // private String type; // private String webUrl; // private String normalizedName; // private List<TopicExpert> experts; // private String name; // private long id; // // public Topic(Strin...
import java.util.Date; import java.util.List; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonDeserialize; import org.springframework.social.yammer.api.Topic; impo...
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public class Topic { // // private String type; // private String webUrl; // private String normalizedName; // private List<TopicExpert> experts; // private String name; // private long id; // // public Topic(Strin...
@JsonProperty("first_reply_at") @JsonDeserialize(using=YammerDateDeserializer.class) Date firstReplyAt,
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/json/TopicMixin.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public static class TopicExpert { // private String type; // private long id; // // public TopicExpert(String type, long id) { // this.type = type; // this.id = id; // } // public String getType() { // return typ...
import java.util.List; import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.springframework.social.yammer.api.Topic.TopicExpert;
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public static class TopicExpert { // private String type; // private long id; // // public TopicExpert(String type, long id) { // this.type = type; // this.id = id; // } // public String getType() { // return typ...
@JsonProperty("experts") List<TopicExpert> experts,
magott/spring-social-yammer
spring-social-yammer/src/test/java/org/springframework/social/yammer/api/impl/SearchTemplateTest.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/SearchResults.java // public class SearchResults { // // private MessageInfo messages; // private List<YammerProfile> users; // private List<Group> groups; // private SearchStats stats; // private List<Topic> topics; // // public...
import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import static org.springframework.http.HttpMethod.GET; import static org.springframework.http.MediaType.APPLICATION_JSON; import ...
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/SearchResults.java // public class SearchResults { // // private MessageInfo messages; // private List<YammerProfile> users; // private List<Group> groups; // private SearchStats stats; // private List<Topic> topics; // // public...
SearchResults searchResults = yammerTemplate.searchOperations().search("foo");
magott/spring-social-yammer
spring-social-yammer/src/test/java/org/springframework/social/yammer/api/impl/ThreadTemplateTest.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/YammerThread.java // public class YammerThread { // // private ThreadStats stats; // private String type; // private String privacy; // private long threadStarterId; // private boolean hasAttachements; // private String webUrl; // ...
import org.junit.Test; import org.springframework.http.MediaType; import org.springframework.social.yammer.api.YammerThread; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import static org.springframework.http.HttpMethod...
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/YammerThread.java // public class YammerThread { // // private ThreadStats stats; // private String type; // private String privacy; // private long threadStarterId; // private boolean hasAttachements; // private String webUrl; // ...
YammerThread thread = yammerTemplate.threadOperations().getThread(123L);
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/connect/YammerServiceProvider.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Yammer.java // public interface Yammer{ // // /** // * Returns the portion of the API containing the Thread operations // */ // ThreadOperations threadOperations(); // // /** // * Returns the portion of the API containing the S...
import org.springframework.social.oauth2.AbstractOAuth2ServiceProvider; import org.springframework.social.yammer.api.Yammer; import org.springframework.social.yammer.api.impl.YammerTemplate;
/* * Copyright 2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Yammer.java // public interface Yammer{ // // /** // * Returns the portion of the API containing the Thread operations // */ // ThreadOperations threadOperations(); // // /** // * Returns the portion of the API containing the S...
return new YammerTemplate(accessToken);
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/ThreadReference.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/YammerThread.java // public static class ThreadStats{ // private Date firstReplyAt; // private Date latestReplyAt; // private long firstReplyId; // private long latestReplyId; // private int messageCount; // private int shares...
import org.springframework.social.yammer.api.YammerThread.ThreadStats;
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/YammerThread.java // public static class ThreadStats{ // private Date firstReplyAt; // private Date latestReplyAt; // private long firstReplyId; // private long latestReplyId; // private int messageCount; // private int shares...
private ThreadStats stats;
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/json/ThreadReferenceMixin.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/YammerThread.java // public static class ThreadStats{ // private Date firstReplyAt; // private Date latestReplyAt; // private long firstReplyId; // private long latestReplyId; // private int messageCount; // private int shares...
import org.codehaus.jackson.annotate.JsonCreator; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.springframework.social.yammer.api.YammerThread.ThreadStats;
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/YammerThread.java // public static class ThreadStats{ // private Date firstReplyAt; // private Date latestReplyAt; // private long firstReplyId; // private long latestReplyId; // private int messageCount; // private int shares...
ThreadStats stats;
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/ThreadTemplate.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/ThreadOperations.java // public interface ThreadOperations { // // /** // * Get information about a thread // * @param id the thread id // * @return {@link YammerThread} // */ // YammerThread getThread(long id); // // } // /...
import org.springframework.social.yammer.api.ThreadOperations; import org.springframework.social.yammer.api.YammerThread; import org.springframework.web.client.RestTemplate;
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/ThreadOperations.java // public interface ThreadOperations { // // /** // * Get information about a thread // * @param id the thread id // * @return {@link YammerThread} // */ // YammerThread getThread(long id); // // } // /...
public YammerThread getThread(long id) {
magott/spring-social-yammer
spring-social-yammer/src/test/java/org/springframework/social/yammer/api/impl/TopicTemplateTest.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public class Topic { // // private String type; // private String webUrl; // private String normalizedName; // private List<TopicExpert> experts; // private String name; // private long id; // // public Topic(Strin...
import org.junit.Test; import org.springframework.social.yammer.api.Topic; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.notNullValue; import static org.junit.Assert.assertThat; import static org.springframework.http.HttpMethod.GET; import static org.springframework.http.Media...
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public class Topic { // // private String type; // private String webUrl; // private String normalizedName; // private List<TopicExpert> experts; // private String name; // private long id; // // public Topic(Strin...
Topic topic = yammerTemplate.topicOperations().getTopic(123L);
magott/spring-social-yammer
spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/TopicTemplate.java
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public class Topic { // // private String type; // private String webUrl; // private String normalizedName; // private List<TopicExpert> experts; // private String name; // private long id; // // public Topic(Strin...
import org.springframework.social.yammer.api.Topic; import org.springframework.social.yammer.api.TopicOperations; import org.springframework.web.client.RestTemplate;
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
// Path: spring-social-yammer/src/main/java/org/springframework/social/yammer/api/Topic.java // public class Topic { // // private String type; // private String webUrl; // private String normalizedName; // private List<TopicExpert> experts; // private String name; // private long id; // // public Topic(Strin...
public Topic getTopic(long id) {
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/v2/ClientLibraryDecoderTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // }
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.params.provider.Arguments.arguments; import com.google.cloud.ByteArray; import com.google.cloud.Date; import com.google.cloud.Timestamp; import com.google.cloud.spa...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // } // Path: cloud-spanner-r2dbc/src/tes...
new ConversionFailureException("2147483648 is out of range for Integer")),
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/SpannerClientLibraryTestKit.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import static io.r2dbc.spi.ConnectionFactoryOptions.DRIVER; import static io.r2...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(DRIVER, DRIVER_NAME)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/SpannerClientLibraryTestKit.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import static io.r2dbc.spi.ConnectionFactoryOptions.DRIVER; import static io.r2...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(INSTANCE, DatabaseProperties.INSTANCE)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-spring-data-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/springdata/SpannerR2dbcDialectProvider.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryMetadata.java // public class SpannerConnectionFactoryMetadata implements ConnectionFactoryMetadata { // // /** // * The name of Cloud Spanner database product. // */ // public static final String NAME = "Cloud ...
import com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryMetadata; import io.r2dbc.spi.ConnectionFactory; import java.util.Optional; import org.springframework.data.r2dbc.dialect.DialectResolver.R2dbcDialectProvider; import org.springframework.data.r2dbc.dialect.R2dbcDialect;
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryMetadata.java // public class SpannerConnectionFactoryMetadata implements ConnectionFactoryMetadata { // // /** // * The name of Cloud Spanner database product. // */ // public static final String NAME = "Cloud ...
if (connectionFactory.getMetadata().getName().equals(SpannerConnectionFactoryMetadata.NAME)) {
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/util/SpannerExceptionUtilTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/util/SpannerExceptionUtil.java // public static R2dbcException createR2dbcException(int errorCode, String message) { // return createR2dbcException(errorCode, message, null); // }
import io.r2dbc.spi.R2dbcTransientResourceException; import java.io.IOException; import org.junit.jupiter.api.Test; import static com.google.cloud.spanner.r2dbc.util.SpannerExceptionUtil.createR2dbcException; import static org.assertj.core.api.Assertions.assertThat; import com.google.protobuf.Duration; import com.googl...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/util/SpannerExceptionUtil.java // public static R2dbcException createR2dbcException(int errorCode, String message) { // return createR2dbcException(errorCode, message, null); // } // Path: cloud-spanner-r2dbc/src/test/java/com/google/cloud/sp...
R2dbcException exception = SpannerExceptionUtil.createR2dbcException(
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/SpannerClientLibraryResult.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/util/Assert.java // public class Assert { // // private Assert() { // // Prevent instantiation. // } // // /** // * Checks that a specified object reference is not {@code null} and throws a customized // * {@link IllegalArgument...
import com.google.cloud.spanner.r2dbc.util.Assert; import io.r2dbc.spi.Result; import io.r2dbc.spi.Row; import io.r2dbc.spi.RowMetadata; import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Predicate; import org.reactivestreams.Publisher; import reactor.core.publisher.Flux...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/util/Assert.java // public class Assert { // // private Assert() { // // Prevent instantiation. // } // // /** // * Checks that a specified object reference is not {@code null} and throws a customized // * {@link IllegalArgument...
this.resultRows = Assert.requireNonNull(resultRows, "A non-null flux of rows is required.");
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/IterableBinder.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/BindingFailureException.java // public class BindingFailureException extends R2dbcNonTransientException { // // public BindingFailureException(String message) { // super(message); // } // } // // Path: cloud-spanner-r2dbc/src/main/java/...
import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.r2dbc.BindingFailureException; import com.google.cloud.spanner.r2dbc.SpannerType;
/* * Copyright 2022-2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/BindingFailureException.java // public class BindingFailureException extends R2dbcNonTransientException { // // public BindingFailureException(String message) { // super(message); // } // } // // Path: cloud-spanner-r2dbc/src/main/java/...
public boolean canBind(Class<?> type, SpannerType spannerType) {
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/IterableBinder.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/BindingFailureException.java // public class BindingFailureException extends R2dbcNonTransientException { // // public BindingFailureException(String message) { // super(message); // } // } // // Path: cloud-spanner-r2dbc/src/main/java/...
import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.r2dbc.BindingFailureException; import com.google.cloud.spanner.r2dbc.SpannerType;
/* * Copyright 2022-2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/BindingFailureException.java // public class BindingFailureException extends R2dbcNonTransientException { // // public BindingFailureException(String message) { // super(message); // } // } // // Path: cloud-spanner-r2dbc/src/main/java/...
throw new BindingFailureException(
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/StringToJsonConverter.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // }
import com.google.cloud.spanner.r2dbc.ConversionFailureException;
/* * Copyright 2021-2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // } // Path: cloud-spanner-r2dbc/src/mai...
throw new ConversionFailureException(
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/SpannerClientLibraryRow.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/util/Assert.java // public class Assert { // // private Assert() { // // Prevent instantiation. // } // // /** // * Checks that a specified object reference is not {@code null} and throws a customized // * {@link IllegalArgument...
import com.google.cloud.spanner.Struct; import com.google.cloud.spanner.r2dbc.util.Assert; import io.r2dbc.spi.Row; import io.r2dbc.spi.RowMetadata;
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/util/Assert.java // public class Assert { // // private Assert() { // // Prevent instantiation. // } // // /** // * Checks that a specified object reference is not {@code null} and throws a customized // * {@link IllegalArgument...
Assert.requireNonNull(rowFields, "rowFields must not be null");
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-spring-data-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/springdata/SpannerR2dbcDialect.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/JsonWrapper.java // public class JsonWrapper { // private String jsonString; // // public JsonWrapper(String jsonString) { // this.jsonString = jsonString; // } // // protected Value getJsonVal() { // return Value.json(this.j...
import com.google.cloud.spanner.r2dbc.v2.JsonWrapper; import com.google.gson.Gson; import java.util.Arrays; import java.util.Collection; import org.springframework.data.r2dbc.dialect.R2dbcDialect; import org.springframework.data.relational.core.dialect.AbstractDialect; import org.springframework.data.relational.core.di...
private static final LockClause LOCK_CLAUSE = new LockClause() { @Override public String getLock(LockOptions lockOptions) { return ""; } @Override public Position getClausePosition() { // It does not matter where to append an empty string. return Position.AFTER_FROM_TABLE; }...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/JsonWrapper.java // public class JsonWrapper { // private String jsonString; // // public JsonWrapper(String jsonString) { // this.jsonString = jsonString; // } // // protected Value getJsonVal() { // return Value.json(this.j...
return Arrays.asList(JsonWrapper.class);
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/SessionCleanupUtils.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/util/ObservableReactiveUtil.java // public class ObservableReactiveUtil { // // /** // * Invokes a lambda that in turn issues a remote call, directing the response to a {@link Mono} // * stream. // * // * @param remoteCall lambda c...
import io.grpc.stub.StreamObserver; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import com.google.auth.oauth2.GoogleCredentials; import com.google.cloud.ServiceOptions; import com.google.cloud.spanner.r2dbc.util.ObservableReactiveUtil; import com.google.protobuf.Empty; import ...
* Exceptions: * - you are running in a CI environment and there are other tests running. * - you want to verify session state after a test. In this case, make another method * verifying the correct number of sessions (exactly 1, greater than 10 etc.) */ static void verifyNoLeftoverSessions() throws E...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/util/ObservableReactiveUtil.java // public class ObservableReactiveUtil { // // /** // * Invokes a lambda that in turn issues a remote call, directing the response to a {@link Mono} // * stream. // * // * @param remoteCall lambda c...
ObservableReactiveUtil.<ListSessionsResponse>unaryCall(
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/LongIntegerConverter.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // }
import com.google.cloud.spanner.r2dbc.ConversionFailureException;
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // } // Path: cloud-spanner-r2dbc/src/mai...
throw new ConversionFailureException(
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/AbstractSpannerClientLibraryStatement.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/statement/TypedNull.java // public class TypedNull { // // private final Class<?> type; // // public TypedNull(Class<?> type) { // this.type = type; // } // // public Class<?> getType() { // return this.type; // } // }
import com.google.cloud.spanner.r2dbc.statement.TypedNull; import com.google.spanner.v1.ExecuteSqlRequest.QueryOptions; import io.r2dbc.spi.Result; import io.r2dbc.spi.Statement; import java.util.ArrayList; import java.util.List; import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; import reactor.c...
return executeMultiple(this.statements); } return executeSingle(this.currentStatementBuilder.build()); } protected abstract Mono<SpannerClientLibraryResult> executeSingle( com.google.cloud.spanner.Statement statement); protected abstract Flux<SpannerClientLibraryResult> executeMultiple( ...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/statement/TypedNull.java // public class TypedNull { // // private final Class<?> type; // // public TypedNull(Class<?> type) { // this.type = type; // } // // public Class<?> getType() { // return this.type; // } // } // P...
ClientLibraryBinder.bind(this.currentStatementBuilder, name, new TypedNull(type));
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/SpannerClientLibraryConverters.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // }
import com.google.cloud.spanner.r2dbc.ConversionFailureException; import java.util.ArrayList; import java.util.List; import java.util.Optional;
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // } // Path: cloud-spanner-r2dbc/src/mai...
throw new ConversionFailureException(
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-spring-data-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/springdata/it/SpannerR2dbcDialectIntegrationTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<String> INSTANCE = Option.valueOf("instance"); // // Path: cloud-spanner-spring-data-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/springdata/it/entities/President.java // ...
import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import static io.r2dbc.spi.ConnectionFactoryOptions.DRIVER; import com.google.cloud.ServiceOptions; import com.google.cloud.spanner.r2dbc.springdata.it.entities.President...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<String> INSTANCE = Option.valueOf("instance"); // // Path: cloud-spanner-spring-data-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/springdata/it/entities/President.java // ...
.option(INSTANCE, TEST_INSTANCE)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-spring-data-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/springdata/it/SpannerR2dbcDialectIntegrationTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<String> INSTANCE = Option.valueOf("instance"); // // Path: cloud-spanner-spring-data-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/springdata/it/entities/President.java // ...
import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import static io.r2dbc.spi.ConnectionFactoryOptions.DRIVER; import com.google.cloud.ServiceOptions; import com.google.cloud.spanner.r2dbc.springdata.it.entities.President...
this.databaseClient = this.r2dbcEntityTemplate.getDatabaseClient(); if (SpannerTestUtils.tableExists(connection, "PRESIDENT")) { this.databaseClient.sql("DROP TABLE PRESIDENT") .fetch() .rowsUpdated() .block(); } this.databaseClient.sql( "CREATE TABLE PRESID...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<String> INSTANCE = Option.valueOf("instance"); // // Path: cloud-spanner-spring-data-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/springdata/it/entities/President.java // ...
insertPresident(new President("Bill Clinton", 1992));
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/SpannerBatch.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/statement/StatementParser.java // public class StatementParser { // // private static com.google.cloud.spanner.connection.AbstractStatementParser clientLibraryParser = // com.google.cloud.spanner.connection.AbstractStatementParser.getIns...
import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.r2dbc.statement.StatementParser; import com.google.cloud.spanner.r2dbc.statement.StatementType; import com.google.cloud.spanner.r2dbc.util.Assert; import io.r2dbc.spi.Batch; import io.r2dbc.spi.Result; import java.util.ArrayList; import java.uti...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/statement/StatementParser.java // public class StatementParser { // // private static com.google.cloud.spanner.connection.AbstractStatementParser clientLibraryParser = // com.google.cloud.spanner.connection.AbstractStatementParser.getIns...
Assert.requireNonNull(sql, "SQL must not be null.");
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/SpannerBatch.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/statement/StatementParser.java // public class StatementParser { // // private static com.google.cloud.spanner.connection.AbstractStatementParser clientLibraryParser = // com.google.cloud.spanner.connection.AbstractStatementParser.getIns...
import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.r2dbc.statement.StatementParser; import com.google.cloud.spanner.r2dbc.statement.StatementType; import com.google.cloud.spanner.r2dbc.util.Assert; import io.r2dbc.spi.Batch; import io.r2dbc.spi.Result; import java.util.ArrayList; import java.uti...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/statement/StatementParser.java // public class StatementParser { // // private static com.google.cloud.spanner.connection.AbstractStatementParser clientLibraryParser = // com.google.cloud.spanner.connection.AbstractStatementParser.getIns...
if (StatementParser.getStatementType(sql) != StatementType.DML) {
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/SpannerBatch.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/statement/StatementParser.java // public class StatementParser { // // private static com.google.cloud.spanner.connection.AbstractStatementParser clientLibraryParser = // com.google.cloud.spanner.connection.AbstractStatementParser.getIns...
import com.google.cloud.spanner.Statement; import com.google.cloud.spanner.r2dbc.statement.StatementParser; import com.google.cloud.spanner.r2dbc.statement.StatementType; import com.google.cloud.spanner.r2dbc.util.Assert; import io.r2dbc.spi.Batch; import io.r2dbc.spi.Result; import java.util.ArrayList; import java.uti...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/statement/StatementParser.java // public class StatementParser { // // private static com.google.cloud.spanner.connection.AbstractStatementParser clientLibraryParser = // com.google.cloud.spanner.connection.AbstractStatementParser.getIns...
if (StatementParser.getStatementType(sql) != StatementType.DML) {
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/SpannerDmlReactiveStreamVerification.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeSuite; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryPro...
/* * Copyright 2021-2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(DRIVER, DRIVER_NAME)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/SpannerDmlReactiveStreamVerification.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeSuite; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryPro...
/* * Copyright 2021-2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(INSTANCE, DatabaseProperties.INSTANCE)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/SpannerSelectReactiveStreamVerification.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import org.reactivestreams.tck.TestEnvironment; import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeSuite; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google...
/* * Copyright 2021-2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(DRIVER, DRIVER_NAME)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/SpannerSelectReactiveStreamVerification.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import org.reactivestreams.tck.TestEnvironment; import org.testng.annotations.AfterSuite; import org.testng.annotations.BeforeSuite; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google...
/* * Copyright 2021-2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(INSTANCE, DatabaseProperties.INSTANCE)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/v2/ClientLibraryTypeBindersTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/BindingFailureException.java // public class BindingFailureException extends R2dbcNonTransientException { // // public BindingFailureException(String message) { // super(message); // } // } // // Path: cloud-spanner-r2dbc/src/main/java/...
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.Assertions.withPrecision; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/BindingFailureException.java // public class BindingFailureException extends R2dbcNonTransientException { // // public BindingFailureException(String message) { // super(message); // } // } // // Path: cloud-spanner-r2dbc/src/main/java/...
.isInstanceOf(BindingFailureException.class)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/v2/ClientLibraryTypeBindersTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/BindingFailureException.java // public class BindingFailureException extends R2dbcNonTransientException { // // public BindingFailureException(String message) { // super(message); // } // } // // Path: cloud-spanner-r2dbc/src/main/java/...
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.assertj.core.api.Assertions.withPrecision; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/BindingFailureException.java // public class BindingFailureException extends R2dbcNonTransientException { // // public BindingFailureException(String message) { // super(message); // } // } // // Path: cloud-spanner-r2dbc/src/main/java/...
TypedNull randNull = new TypedNull(Random.class);
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-spring-data-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/springdata/SpannerR2dbcDialectTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/JsonWrapper.java // public class JsonWrapper { // private String jsonString; // // public JsonWrapper(String jsonString) { // this.jsonString = jsonString; // } // // protected Value getJsonVal() { // return Value.json(this.j...
import org.springframework.data.relational.core.sql.Table; import org.springframework.r2dbc.core.binding.BindMarkers; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.cloud...
@Test void testBindMarkersFactory() { SpannerR2dbcDialect dialect = new SpannerR2dbcDialect(); BindMarkers bindMarkers = dialect.getBindMarkersFactory().create(); assertThat(bindMarkers).isNotNull(); assertThat(bindMarkers.next().getPlaceholder()).isEqualTo("@val0"); assertThat(bindMarkers.next...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/JsonWrapper.java // public class JsonWrapper { // private String jsonString; // // public JsonWrapper(String jsonString) { // this.jsonString = jsonString; // } // // protected Value getJsonVal() { // return Value.json(this.j...
assertThat(simpleTypeHolder.isSimpleType(JsonWrapper.class)).isTrue();
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/v2/SpannerClientLibraryConvertersTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // }
import static org.assertj.core.api.AssertionsForClassTypes.assertThat; import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; import com.google.cloud.spanner.r2dbc.ConversionFailureException; import org.junit.jupiter.api.Test;
/* * Copyright 2021-2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // } // Path: cloud-spanner-r2dbc/src/tes...
.isInstanceOf(ConversionFailureException.class)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/v2/StringToJsonConverterTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // }
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; import com.google.cloud.spanner.r2dbc.ConversionFailureException; import org.assertj.core.api.AssertionsForClassTypes; import org.junit.jupiter.api.Test;
/* * Copyright 2021-2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/ConversionFailureException.java // public class ConversionFailureException extends R2dbcNonTransientException { // // public ConversionFailureException(String message) { // super(message); // } // } // Path: cloud-spanner-r2dbc/src/tes...
.isInstanceOf(ConversionFailureException.class)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionConfiguration.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/util/Assert.java // public class Assert { // // private Assert() { // // Prevent instantiation. // } // // /** // * Checks that a specified object reference is not {@code null} and throws a customized // * {@link IllegalArgument...
import com.google.auth.oauth2.GoogleCredentials; import com.google.auth.oauth2.OAuth2Credentials; import com.google.cloud.spanner.SpannerOptions; import com.google.cloud.spanner.r2dbc.util.Assert; import io.r2dbc.spi.ConnectionFactoryOptions; import io.r2dbc.spi.R2dbcNonTransientResourceException; import java.io.IOExce...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/util/Assert.java // public class Assert { // // private Assert() { // // Prevent instantiation. // } // // /** // * Checks that a specified object reference is not {@code null} and throws a customized // * {@link IllegalArgument...
Assert.requireNonNull(projectId, "projectId must not be null");
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc-samples/cloud-spanner-spring-data-r2dbc-sample/src/main/java/com/example/SpringDataR2dbcApp.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<String> INSTANCE = Option.valueOf("instance");
import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import static org.springframework.web.reactive.function.server.RequestPredicates.GET; import static org.springframework.web.reactive.function.server.RouterFunctions.route...
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<String> INSTANCE = Option.valueOf("instance"); // Path: cloud-spanner-r2dbc-samples/cloud-spanner-spring-data-r2dbc-sample/src/main/java/com/example/SpringDataR2dbcApp.java imp...
Assert.notNull(INSTANCE, "Please provide spanner.instance property");
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-spring-data-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/springdata/SpannerBindMarkerFactoryProvider.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryMetadata.java // public class SpannerConnectionFactoryMetadata implements ConnectionFactoryMetadata { // // /** // * The name of Cloud Spanner database product. // */ // public static final String NAME = "Cloud ...
import com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryMetadata; import io.r2dbc.spi.ConnectionFactory; import org.springframework.r2dbc.core.binding.BindMarkersFactory; import org.springframework.r2dbc.core.binding.BindMarkersFactoryResolver.BindMarkerFactoryProvider;
/* * Copyright 2021-2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryMetadata.java // public class SpannerConnectionFactoryMetadata implements ConnectionFactoryMetadata { // // /** // * The name of Cloud Spanner database product. // */ // public static final String NAME = "Cloud ...
if (SpannerConnectionFactoryMetadata.INSTANCE.equals(connectionFactory.getMetadata())) {
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc-samples/cloud-spanner-spring-data-r2dbc-sample/src/main/java/com/example/CustomConfiguration.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/JsonWrapper.java // public class JsonWrapper { // private String jsonString; // // public JsonWrapper(String jsonString) { // this.jsonString = jsonString; // } // // protected Value getJsonVal() { // return Value.json(this.j...
import java.util.ArrayList; import java.util.List; import com.google.cloud.spanner.r2dbc.v2.JsonWrapper; import com.google.gson.Gson; import com.google.gson.JsonParseException; import io.r2dbc.spi.ConnectionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.Applic...
/* * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/JsonWrapper.java // public class JsonWrapper { // private String jsonString; // // public JsonWrapper(String jsonString) { // this.jsonString = jsonString; // } // // protected Value getJsonVal() { // return Value.json(this.j...
public class JsonToReviewsConverter implements Converter<JsonWrapper, Review> {
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/SpannerClientLibraryConnection.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/api/SpannerConnection.java // public interface SpannerConnection { // /** // * Allows starting a readonly Cloud Spanner transaction with given staleness settings. // * // * @param timestampBound staleness settings // * // * @retu...
import com.google.cloud.spanner.TimestampBound; import com.google.cloud.spanner.r2dbc.api.SpannerConnection; import com.google.cloud.spanner.r2dbc.statement.StatementParser; import com.google.cloud.spanner.r2dbc.statement.StatementType; import io.r2dbc.spi.Batch; import io.r2dbc.spi.Connection; import io.r2dbc.spi.Conn...
@Override public Mono<Void> beginReadonlyTransaction(TimestampBound timestampBound) { return this.clientLibraryAdapter.beginReadonlyTransaction(timestampBound); } @Override public Mono<Void> beginReadonlyTransaction() { return this.clientLibraryAdapter.beginReadonlyTransaction(TimestampBound.strong()...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/api/SpannerConnection.java // public interface SpannerConnection { // /** // * Allows starting a readonly Cloud Spanner transaction with given staleness settings. // * // * @param timestampBound staleness settings // * // * @retu...
StatementType type = StatementParser.getStatementType(query);
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/SpannerClientLibraryConnection.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/api/SpannerConnection.java // public interface SpannerConnection { // /** // * Allows starting a readonly Cloud Spanner transaction with given staleness settings. // * // * @param timestampBound staleness settings // * // * @retu...
import com.google.cloud.spanner.TimestampBound; import com.google.cloud.spanner.r2dbc.api.SpannerConnection; import com.google.cloud.spanner.r2dbc.statement.StatementParser; import com.google.cloud.spanner.r2dbc.statement.StatementType; import io.r2dbc.spi.Batch; import io.r2dbc.spi.Connection; import io.r2dbc.spi.Conn...
@Override public Mono<Void> beginReadonlyTransaction(TimestampBound timestampBound) { return this.clientLibraryAdapter.beginReadonlyTransaction(timestampBound); } @Override public Mono<Void> beginReadonlyTransaction() { return this.clientLibraryAdapter.beginReadonlyTransaction(TimestampBound.strong()...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/api/SpannerConnection.java // public interface SpannerConnection { // /** // * Allows starting a readonly Cloud Spanner transaction with given staleness settings. // * // * @param timestampBound staleness settings // * // * @retu...
StatementType type = StatementParser.getStatementType(query);
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/DatabaseClientTransactionManager.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/DatabaseClientReactiveAdapter.java // public static final Executor REACTOR_EXECUTOR = // runnable -> Schedulers.parallel().schedule(runnable); // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/TransactionInProgr...
import java.util.function.Function; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static com.google.cloud.spanner.r2dbc.v2.DatabaseClientReactiveAdapter.REACTOR_EXECUTOR; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.cloud.Timestamp; import com.google.c...
/* * Copyright 2020-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/DatabaseClientReactiveAdapter.java // public static final Executor REACTOR_EXECUTOR = // runnable -> Schedulers.parallel().schedule(runnable); // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/TransactionInProgr...
throw new TransactionInProgressException(this.isInReadWriteTransaction());
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/DatabaseClientTransactionManager.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/DatabaseClientReactiveAdapter.java // public static final Executor REACTOR_EXECUTOR = // runnable -> Schedulers.parallel().schedule(runnable); // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/TransactionInProgr...
import java.util.function.Function; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import static com.google.cloud.spanner.r2dbc.v2.DatabaseClientReactiveAdapter.REACTOR_EXECUTOR; import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; import com.google.cloud.Timestamp; import com.google.c...
*/ ApiFuture<Void> rollbackTransaction() { if (isInReadWriteTransaction()) { if (this.lastStep == null) { LOGGER.warn("Read/Write transaction rolling back without any statements."); } return this.transactionManager.rollbackAsync(); } LOGGER.warn("Rollback called outside of an...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/v2/DatabaseClientReactiveAdapter.java // public static final Executor REACTOR_EXECUTOR = // runnable -> Schedulers.parallel().schedule(runnable); // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/TransactionInProgr...
(ctx, unusedVoid) -> operation.apply(ctx), REACTOR_EXECUTOR)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/ClientLibraryDdlIntegrationTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import static io.r2dbc.spi.ConnectionFactoryOptions.DRIVER; import com.google.c...
/* * Copyright 2021-2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(DRIVER, DRIVER_NAME)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/ClientLibraryDdlIntegrationTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import static io.r2dbc.spi.ConnectionFactoryOptions.DRIVER; import com.google.c...
/* * Copyright 2021-2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(INSTANCE, DatabaseProperties.INSTANCE)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/TestDatabaseHelper.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import ...
public void addTestData(String title, int category) { int suffix = Math.abs(this.random.nextInt()); Mono.from( this.connection .createStatement(INSERT_DATA_QUERY) .bind("uuid", "autoinserted-" + suffix) .bind("title", title) .bind("category", category) ...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(DRIVER, DRIVER_NAME)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/TestDatabaseHelper.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import ...
int suffix = Math.abs(this.random.nextInt()); Mono.from( this.connection .createStatement(INSERT_DATA_QUERY) .bind("uuid", "autoinserted-" + suffix) .bind("title", title) .bind("category", category) .execute()) .flatMapMany(rs -> rs.get...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(INSTANCE, DatabaseProperties.INSTANCE)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/v2/DatabaseClientTransactionManagerTest.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/TransactionInProgressException.java // public class TransactionInProgressException extends R2dbcNonTransientException { // // public static final String MSG_READONLY = // "Cannot begin a new transaction because a readonly transaction is ...
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoInteractions; import sta...
/* * Copyright 2020-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/TransactionInProgressException.java // public class TransactionInProgressException extends R2dbcNonTransientException { // // public static final String MSG_READONLY = // "Cannot begin a new transaction because a readonly transaction is ...
).isInstanceOf(TransactionInProgressException.class)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc-samples/cloud-spanner-r2dbc-sample/src/main/java/com/example/BookExampleApp.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import ...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(DRIVER, DRIVER_NAME)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc-samples/cloud-spanner-r2dbc-sample/src/main/java/com/example/BookExampleApp.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import ...
/* * Copyright 2019-2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.option(INSTANCE, sampleInstance)
GoogleCloudPlatform/cloud-spanner-r2dbc
cloud-spanner-r2dbc-samples/cloud-spanner-r2dbc-sample/src/main/java/com/example/BookExampleApp.java
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME; import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE; import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE; import ...
+ " TITLE STRING(MAX) NOT NULL," + " EXTRADETAILS JSON" + ") PRIMARY KEY (ID)").execute()) .doOnSuccess(x -> System.out.println("Table creation completed.")) .block(); } /** * Saves two books. */ public void saveBooks() { Statement statement = this....
// Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final String DRIVER_NAME = "cloudspanner"; // // Path: cloud-spanner-r2dbc/src/main/java/com/google/cloud/spanner/r2dbc/SpannerConnectionFactoryProvider.java // public static final Option<St...
.bind("extradetails", new JsonWrapper("{\"rating\":9,\"series\":true}"));
Jarlakxen/eclipse-sbt-plugin
com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/action/MigrateAction.java
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/wizard/migrate/MigrationWizard.java // public class MigrationWizard extends Wizard { // // private MigrateToSbtProjectConfiguration configuration = MigrateToSbtProjectConfiguration.getDefault(); // // public MigrationWizard(IProject pr...
import org.eclipse.core.resources.IProject; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.ui.IObjectActionDelega...
package com.github.jarlakxen.scala.sbt.action; /** * Migrates the selected SBT project to ScalaIDE. * * @author Naoki Takezoe */ public class MigrateAction implements IObjectActionDelegate { private IProject project; private IWorkbenchPart targetPart; @Override public void run(IAction action...
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/wizard/migrate/MigrationWizard.java // public class MigrationWizard extends Wizard { // // private MigrateToSbtProjectConfiguration configuration = MigrateToSbtProjectConfiguration.getDefault(); // // public MigrationWizard(IProject pr...
WizardDialog dialog = new WizardDialog(targetPart.getSite().getShell(), new MigrationWizard(project));
Jarlakxen/eclipse-sbt-plugin
com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/action/UpdateProjectConfigurationAction.java
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtPlugin.java // public class SbtPlugin extends AbstractUIPlugin { // // public static final String[] PROJECT_NATURES_IDS = new String[] { // ScalaPlugin.plugin().natureId(), // "org.eclipse.jdt.core.javanature", // SbtPlugin.NAT...
import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.action.IAction; import com.github.jarlakxen.scala.sbt.SbtPlugin;
package com.github.jarlakxen.scala.sbt.action; /** * Updates project dependency. * * @author Facundo Viale */ public class UpdateProjectConfigurationAction extends AbstractSbtCommandAction { public UpdateProjectConfigurationAction() { super("update eclipse"); } @Override public void run(I...
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtPlugin.java // public class SbtPlugin extends AbstractUIPlugin { // // public static final String[] PROJECT_NATURES_IDS = new String[] { // ScalaPlugin.plugin().natureId(), // "org.eclipse.jdt.core.javanature", // SbtPlugin.NAT...
SbtPlugin.addProjectNatures(project);
Jarlakxen/eclipse-sbt-plugin
com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/builder/TestLibrary.java
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/ScalaVersion.java // public enum ScalaVersion { // V_2_10_3("2.10.3"), // V_2_10_2("2.10.2"), // V_2_10_1("2.10.1"), // V_2_9_3("2.9.3"), // V_2_9_2("2.9.2"); // // public static ScalaVersion getDefault() { // return V_2_10_3; // } // ...
import java.util.HashMap; import java.util.Map; import com.github.jarlakxen.scala.sbt.ScalaVersion;
package com.github.jarlakxen.scala.sbt.builder; public enum TestLibrary { SPECS2 { @Override protected void populate(Map<String, String> dependancyMap) { dependancyMap.put("2.10", "\"org.specs2\" %% \"specs2\" % \"2.2.3\" % \"test\""); dependancyMap.put("2.9", "\"org.specs2\" %% \"specs2\" % \"1.12.4.1\" ...
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/ScalaVersion.java // public enum ScalaVersion { // V_2_10_3("2.10.3"), // V_2_10_2("2.10.2"), // V_2_10_1("2.10.1"), // V_2_9_3("2.9.3"), // V_2_9_2("2.9.2"); // // public static ScalaVersion getDefault() { // return V_2_10_3; // } // ...
public String getDependancy(ScalaVersion version) {
Jarlakxen/eclipse-sbt-plugin
com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtPlugin.java
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/listener/SbtProjectFilesChangeListener.java // public class SbtProjectFilesChangeListener implements IResourceChangeListener { // // private static final List<String> SBT_PROJECT_FILES = asList("build.sbt", "project/plugins.sbt", "project/buil...
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.Im...
package com.github.jarlakxen.scala.sbt; /** * The activator class controls the plug-in life cycle * * @author Naoki Takezoe */ public class SbtPlugin extends AbstractUIPlugin { public static final String[] PROJECT_NATURES_IDS = new String[] { ScalaPlugin.plugin().natureId(), "org.eclipse....
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/listener/SbtProjectFilesChangeListener.java // public class SbtProjectFilesChangeListener implements IResourceChangeListener { // // private static final List<String> SBT_PROJECT_FILES = asList("build.sbt", "project/plugins.sbt", "project/buil...
SbtProjectFilesChangeListener.register();
Jarlakxen/eclipse-sbt-plugin
com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/configurations/CreateSbtProjectConfiguration.java
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtVersion.java // public enum SbtVersion { // // /** // * SBT 0.11 // */ // SBT011("0.11", "0.11.3-2"), // // /** // * SBT 0.12 // */ // SBT012("0.12", "0.12.4"), // // /** // * SBT 0.13 // */ // SBT013("0.13...
import org.eclipse.core.resources.IProject; import com.github.jarlakxen.scala.sbt.SbtVersion; import com.github.jarlakxen.scala.sbt.ScalaVersion; import com.github.jarlakxen.scala.sbt.builder.TestLibrary; import com.github.jarlakxen.scala.sbt.wizard.create.SbtWizard;
package com.github.jarlakxen.scala.sbt.configurations; /** * Configuration for create SBT project. * * @see SbtWizard * @author Facundo Viale */ public class CreateSbtProjectConfiguration { public static CreateSbtProjectConfiguration getDefault(){ CreateSbtProjectConfiguration configuration = new CreateSb...
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtVersion.java // public enum SbtVersion { // // /** // * SBT 0.11 // */ // SBT011("0.11", "0.11.3-2"), // // /** // * SBT 0.12 // */ // SBT012("0.12", "0.12.4"), // // /** // * SBT 0.13 // */ // SBT013("0.13...
configuration.setSbtVersion(SbtVersion.SBT013);
Jarlakxen/eclipse-sbt-plugin
com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtPropertyPage.java
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/util/UIUtil.java // public class UIUtil { // // /** // * Creates the Label with the given text. // * // * @param parent // * the parent composite // * @param text // * the label text // */ // pub...
import java.util.ArrayList; import java.util.List; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.sw...
package com.github.jarlakxen.scala.sbt; /** * The property page to configure the SBT project. * * @author Naoki Takezoe */ public class SbtPropertyPage extends PropertyPage implements IWorkbenchPropertyPage { private List<Button> sbtRadioButtons; @Override protected Control createContents(Co...
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/util/UIUtil.java // public class UIUtil { // // /** // * Creates the Label with the given text. // * // * @param parent // * the parent composite // * @param text // * the label text // */ // pub...
UIUtil.createLabel(composite, "SBT Version:");
Jarlakxen/eclipse-sbt-plugin
com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/builder/TemplateBuilder.java
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtVersion.java // public enum SbtVersion { // // /** // * SBT 0.11 // */ // SBT011("0.11", "0.11.3-2"), // // /** // * SBT 0.12 // */ // SBT012("0.12", "0.12.4"), // // /** // * SBT 0.13 // */ // SBT013("0.13...
import java.util.ArrayList; import java.util.List; import org.apache.commons.lang.StringUtils; import com.github.jarlakxen.scala.sbt.SbtVersion; import com.github.jarlakxen.scala.sbt.ScalaVersion; import com.github.jarlakxen.scala.sbt.wizard.create.SbtWizard;
package com.github.jarlakxen.scala.sbt.builder; /** * TemplateBuilder for SBT files * * @see SbtWizard * @author Facundo Viale */ public class TemplateBuilder { private static final String BR = System.getProperty("line.separator"); // Template for build.sbt public static SbtTemplateBuilder createSbtTempla...
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtVersion.java // public enum SbtVersion { // // /** // * SBT 0.11 // */ // SBT011("0.11", "0.11.3-2"), // // /** // * SBT 0.12 // */ // SBT012("0.12", "0.12.4"), // // /** // * SBT 0.13 // */ // SBT013("0.13...
private ScalaVersion scalaVersion;
Jarlakxen/eclipse-sbt-plugin
com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/builder/TemplateBuilder.java
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtVersion.java // public enum SbtVersion { // // /** // * SBT 0.11 // */ // SBT011("0.11", "0.11.3-2"), // // /** // * SBT 0.12 // */ // SBT012("0.12", "0.12.4"), // // /** // * SBT 0.13 // */ // SBT013("0.13...
import java.util.ArrayList; import java.util.List; import org.apache.commons.lang.StringUtils; import com.github.jarlakxen.scala.sbt.SbtVersion; import com.github.jarlakxen.scala.sbt.ScalaVersion; import com.github.jarlakxen.scala.sbt.wizard.create.SbtWizard;
if (webNature) { builder.append("seq(webSettings :_*)").append(BR).append(BR); } List<String> libraryDependencies = new ArrayList<String>(); if (testLibrary != null) { libraryDependencies.add( testLibrary.getDependancy(scalaVersion)); } if (webNature) { libraryDependencies.add( "\"org.m...
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtVersion.java // public enum SbtVersion { // // /** // * SBT 0.11 // */ // SBT011("0.11", "0.11.3-2"), // // /** // * SBT 0.12 // */ // SBT012("0.12", "0.12.4"), // // /** // * SBT 0.13 // */ // SBT013("0.13...
private SbtVersion sbtVersion;
Jarlakxen/eclipse-sbt-plugin
com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtExecutor.java
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/util/UIUtil.java // public class UIUtil { // // /** // * Creates the Label with the given text. // * // * @param parent // * the parent composite // * @param text // * the label text // */ // pub...
import java.io.File; import java.net.URI; import java.net.URL; import java.util.Arrays; import org.eclipse.core.net.proxy.IProxyData; import org.eclipse.core.net.proxy.IProxyService; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.Path; import org.eclipse.debug.core.DebugPlugin; imp...
// Creates new configuration ILaunchConfigurationWorkingCopy wc = null; if(command == null || command.length() == 0){ wc = type.newInstance(null, String.format("sbt - %s", project.getName())); } else { wc = type.newInstance(null, String.format("sbt %s - %s", command, project.getName())); ...
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/util/UIUtil.java // public class UIUtil { // // /** // * Creates the Label with the given text. // * // * @param parent // * the parent composite // * @param text // * the label text // */ // pub...
UIUtil.showErrorDialog("Can't find SBT runtime in your project.");
Jarlakxen/eclipse-sbt-plugin
com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/action/DownloadSourceAction.java
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtPlugin.java // public class SbtPlugin extends AbstractUIPlugin { // // public static final String[] PROJECT_NATURES_IDS = new String[] { // ScalaPlugin.plugin().natureId(), // "org.eclipse.jdt.core.javanature", // SbtPlugin.NAT...
import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.action.IAction; import com.github.jarlakxen.scala.sbt.SbtPlugin;
package com.github.jarlakxen.scala.sbt.action; /** * Updates project dependency. * * @author Facundo Viale */ public class DownloadSourceAction extends AbstractSbtCommandAction { public DownloadSourceAction() { super("'eclipse with-source=true'"); } @Override public void run(IAction actio...
// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtPlugin.java // public class SbtPlugin extends AbstractUIPlugin { // // public static final String[] PROJECT_NATURES_IDS = new String[] { // ScalaPlugin.plugin().natureId(), // "org.eclipse.jdt.core.javanature", // SbtPlugin.NAT...
SbtPlugin.addProjectNatures(project);
caligin/tinytypes
examples/src/test/java/tech/anima/tinytypes/examples/DropwizardJerseyClientTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import com.codahale.metrics.MetricRegistry; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.dropwizard.client.JerseyClientBuilder; import io.dropwizard.client.JerseyClientConfiguration; import io.dropwizard.setup.Environment; import io.dropwizard....
package tech.anima.tinytypes.examples; @RunWith(Enclosed.class) public class DropwizardJerseyClientTest { @RunWith(Theories.class) public static class JsonBodySerializationTest {
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
private final Environment dwEnvironment = new Environment("env", new ObjectMapper().registerModule(new TinyTypesModule()), Validation.buildDefaultValidatorFactory().getValidator(), new MetricRegistry(), this.getClass().getClassLoader());
caligin/tinytypes
examples/src/test/java/tech/anima/tinytypes/examples/DropwizardJerseyClientTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import com.codahale.metrics.MetricRegistry; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.dropwizard.client.JerseyClientBuilder; import io.dropwizard.client.JerseyClientConfiguration; import io.dropwizard.setup.Environment; import io.dropwizard....
package tech.anima.tinytypes.examples; @RunWith(Enclosed.class) public class DropwizardJerseyClientTest { @RunWith(Theories.class) public static class JsonBodySerializationTest { private final Environment dwEnvironment = new Environment("env", new ObjectMapper().registerModule(new TinyTypesModule())...
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
public static final Object[] tts = new Object[]{new Samples.Boolean(true), new Samples.Str("1"), new Samples.Byte((byte) 1), new Samples.Short((byte) 1), new Samples.Integer(1), new Samples.Long(1)};
caligin/tinytypes
jersey/src/main/java/tech/anima/tinytypes/jersey/TinyTypesHeaderDelegateProvider.java
// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyType.java // public interface MetaTinyType<T> { // // /** // * Checks whether this implementation can operate on the given TinyType // * class type. // * // * @param candidate the TInyType type to check for compatibility // * @r...
import javax.ws.rs.ext.Provider; import tech.anima.tinytypes.meta.MetaTinyType; import tech.anima.tinytypes.meta.MetaTinyTypes; import org.glassfish.jersey.spi.HeaderDelegateProvider;
package tech.anima.tinytypes.jersey; @Provider public class TinyTypesHeaderDelegateProvider<T> implements HeaderDelegateProvider<T> { private final Class<T> type;
// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyType.java // public interface MetaTinyType<T> { // // /** // * Checks whether this implementation can operate on the given TinyType // * class type. // * // * @param candidate the TInyType type to check for compatibility // * @r...
private final MetaTinyType<T> meta;
caligin/tinytypes
jersey/src/main/java/tech/anima/tinytypes/jersey/TinyTypesHeaderDelegateProvider.java
// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyType.java // public interface MetaTinyType<T> { // // /** // * Checks whether this implementation can operate on the given TinyType // * class type. // * // * @param candidate the TInyType type to check for compatibility // * @r...
import javax.ws.rs.ext.Provider; import tech.anima.tinytypes.meta.MetaTinyType; import tech.anima.tinytypes.meta.MetaTinyTypes; import org.glassfish.jersey.spi.HeaderDelegateProvider;
package tech.anima.tinytypes.jersey; @Provider public class TinyTypesHeaderDelegateProvider<T> implements HeaderDelegateProvider<T> { private final Class<T> type; private final MetaTinyType<T> meta; public TinyTypesHeaderDelegateProvider(Class<T> concrete) { this.type = concrete;
// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyType.java // public interface MetaTinyType<T> { // // /** // * Checks whether this implementation can operate on the given TinyType // * class type. // * // * @param candidate the TInyType type to check for compatibility // * @r...
this.meta = MetaTinyTypes.metaFor(concrete);
caligin/tinytypes
meta/src/test/java/tech/anima/tinytypes/meta/MetaTinyTypesTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import tech.anima.tinytypes.Samples; import org.junit.Assert; import org.junit.Test; import org.junit.experimental.runners.Enclosed; import org.junit.experimental.theories.DataPoints; import org.junit.experimental.theories.FromDataPoints; import org.junit.experimental.theories.Theories; import org.junit.experimental.th...
package tech.anima.tinytypes.meta; @RunWith(Enclosed.class) public class MetaTinyTypesTest { @RunWith(Theories.class) public static class IsTinyType { @DataPoints("tts") public static final Class<?>[] tinyTypesSamples = new Class<?>[]{
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
Samples.Str.class,
caligin/tinytypes
jersey/src/main/java/tech/anima/tinytypes/jersey/TinyTypesParamProvider.java
// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyType.java // public interface MetaTinyType<T> { // // /** // * Checks whether this implementation can operate on the given TinyType // * class type. // * // * @param candidate the TInyType type to check for compatibility // * @r...
import java.lang.annotation.Annotation; import java.lang.reflect.Type; import javax.ws.rs.ext.ParamConverter; import javax.ws.rs.ext.ParamConverterProvider; import javax.ws.rs.ext.Provider; import tech.anima.tinytypes.meta.MetaTinyType; import tech.anima.tinytypes.meta.MetaTinyTypes;
package tech.anima.tinytypes.jersey; @Provider public class TinyTypesParamProvider implements ParamConverterProvider { @Override public <T> ParamConverter<T> getConverter(final Class<T> rawType, Type genericType, Annotation[] annotations) {
// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyType.java // public interface MetaTinyType<T> { // // /** // * Checks whether this implementation can operate on the given TinyType // * class type. // * // * @param candidate the TInyType type to check for compatibility // * @r...
if (MetaTinyTypes.isTinyType(rawType)) {
caligin/tinytypes
jersey/src/main/java/tech/anima/tinytypes/jersey/TinyTypesParamProvider.java
// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyType.java // public interface MetaTinyType<T> { // // /** // * Checks whether this implementation can operate on the given TinyType // * class type. // * // * @param candidate the TInyType type to check for compatibility // * @r...
import java.lang.annotation.Annotation; import java.lang.reflect.Type; import javax.ws.rs.ext.ParamConverter; import javax.ws.rs.ext.ParamConverterProvider; import javax.ws.rs.ext.Provider; import tech.anima.tinytypes.meta.MetaTinyType; import tech.anima.tinytypes.meta.MetaTinyTypes;
package tech.anima.tinytypes.jersey; @Provider public class TinyTypesParamProvider implements ParamConverterProvider { @Override public <T> ParamConverter<T> getConverter(final Class<T> rawType, Type genericType, Annotation[] annotations) { if (MetaTinyTypes.isTinyType(rawType)) { return ...
// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyType.java // public interface MetaTinyType<T> { // // /** // * Checks whether this implementation can operate on the given TinyType // * class type. // * // * @param candidate the TInyType type to check for compatibility // * @r...
private final MetaTinyType<T> meta;
caligin/tinytypes
meta/src/test/java/tech/anima/tinytypes/meta/ByteTinyTypesTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import tech.anima.tinytypes.Samples; import org.junit.Test; import org.junit.Assert; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith;
package tech.anima.tinytypes.meta; @RunWith(Enclosed.class) public class ByteTinyTypesTest { public static class IsMetaOf { @Test public void yieldsTrueWhenCandidateSuperclassIsByteTT() {
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
final boolean got = new ByteTinyTypes().isMetaOf(Samples.Byte.class);
caligin/tinytypes
meta/src/test/java/tech/anima/tinytypes/meta/LongTinyTypesTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import tech.anima.tinytypes.Samples; import org.junit.Test; import org.junit.Assert; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith;
package tech.anima.tinytypes.meta; @RunWith(Enclosed.class) public class LongTinyTypesTest { public static class IsMetaOf { @Test public void yieldsTrueWhenCandidateSuperclassIsLongTT() {
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
final boolean got = new LongTinyTypes().isMetaOf(Samples.Long.class);
caligin/tinytypes
jersey/src/test/java/tech/anima/tinytypes/jersey/TinyTypesParamProviderTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import javax.ws.rs.ext.ParamConverter; import tech.anima.tinytypes.Samples; import static org.hamcrest.core.Is.is; import static org.hamcrest.core.IsInstanceOf.instanceOf; import org.junit.Assert; import org.junit.Test; import org.junit.experimental.runners.Enclosed; import org.junit.experimental.theories.DataPoints; i...
package tech.anima.tinytypes.jersey; @RunWith(Enclosed.class) public class TinyTypesParamProviderTest { @RunWith(Theories.class) public static class GetConverter { @Test public void yieldsNullWhenTypeIsNotATinyType() { final Class<?> type = null; final ParamConverter<...
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
Samples.Str.class,
caligin/tinytypes
jackson/src/test/java/tech/anima/tinytypes/jackson/TinyTypesSerializersTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; import com.faster...
package tech.anima.tinytypes.jackson; @RunWith(Enclosed.class) public class TinyTypesSerializersTest { @RunWith(Theories.class) public static class FindSerializer { @Test public void delegatesToOtherWhenTypeIsNotATinyType() throws JsonMappingException { final JavaType typeForObje...
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
Samples.Str.class,
caligin/tinytypes
jackson/src/test/java/tech/anima/tinytypes/jackson/TinyTypesKeyDeserializersTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.KeyDeserializer; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; import com.faste...
package tech.anima.tinytypes.jackson; @RunWith(Enclosed.class) public class TinyTypesKeyDeserializersTest { @RunWith(Theories.class) public static class FindKeyDeserializer { @Test public void yieldsNullWhenTypeIsNotATinyType() throws JsonMappingException { final JavaType typeFor...
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
Samples.Str.class,
caligin/tinytypes
jackson/src/main/java/tech/anima/tinytypes/jackson/TinyTypesKeyDeserializers.java
// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyTypes.java // public abstract class MetaTinyTypes { // // public static final MetaTinyType[] metas = new MetaTinyType[]{ // new StringTinyTypes(), // new BooleanTinyTypes(), // new ByteTinyTypes(), // new ShortTinyTypes()...
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.BeanDescription; import com.fasterxml.jackson.databind.DeserializationConfig; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databi...
package tech.anima.tinytypes.jackson; public class TinyTypesKeyDeserializers implements KeyDeserializers { @Override public KeyDeserializer findKeyDeserializer(JavaType type, DeserializationConfig config, BeanDescription beanDesc) throws JsonMappingException { final Class<?> candidateTT = type.getRaw...
// Path: meta/src/main/java/tech/anima/tinytypes/meta/MetaTinyTypes.java // public abstract class MetaTinyTypes { // // public static final MetaTinyType[] metas = new MetaTinyType[]{ // new StringTinyTypes(), // new BooleanTinyTypes(), // new ByteTinyTypes(), // new ShortTinyTypes()...
if (MetaTinyTypes.isTinyType(candidateTT)) {
caligin/tinytypes
meta/src/test/java/tech/anima/tinytypes/meta/BooleanTinyTypesTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import tech.anima.tinytypes.Samples; import tech.anima.tinytypes.Samples.BooleanIndirectAncestor; import org.junit.Test; import org.junit.Assert; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith;
package tech.anima.tinytypes.meta; @RunWith(Enclosed.class) public class BooleanTinyTypesTest { public static class IsMetaOf { @Test public void yieldsTrueWhenCandidateSuperclassIsBooleanTT() {
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
final boolean got = new BooleanTinyTypes().isMetaOf(Samples.Boolean.class);
caligin/tinytypes
meta/src/test/java/tech/anima/tinytypes/meta/BooleanTinyTypesTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import tech.anima.tinytypes.Samples; import tech.anima.tinytypes.Samples.BooleanIndirectAncestor; import org.junit.Test; import org.junit.Assert; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith;
package tech.anima.tinytypes.meta; @RunWith(Enclosed.class) public class BooleanTinyTypesTest { public static class IsMetaOf { @Test public void yieldsTrueWhenCandidateSuperclassIsBooleanTT() { final boolean got = new BooleanTinyTypes().isMetaOf(Samples.Boolean.class); As...
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
final boolean got = new BooleanTinyTypes().isMetaOf(BooleanIndirectAncestor.class);
caligin/tinytypes
examples/src/test/java/tech/anima/tinytypes/examples/DropwizardBootstrapTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import io.dropwizard.Application; import io.dropwizard.Configuration; import io.dropwizard.setup.Bootstrap; import io.dropwizard.setup.Environment; import org.junit.Assert; import org.junit.Test; import tech.anima...
package tech.anima.tinytypes.examples; public class DropwizardBootstrapTest { @Test public void canLoadYamlDWConfigFileWithTinyTypes() throws Exception { new TestApplication().run(new String[]{"server", ClassLoader.getSystemClassLoader().getResource("tts.yml").getPath().toString()}); } ...
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
bootstrap.getObjectMapper().registerModule(new TinyTypesModule());
caligin/tinytypes
examples/src/test/java/tech/anima/tinytypes/examples/DropwizardBootstrapTest.java
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import io.dropwizard.Application; import io.dropwizard.Configuration; import io.dropwizard.setup.Bootstrap; import io.dropwizard.setup.Environment; import org.junit.Assert; import org.junit.Test; import tech.anima...
package tech.anima.tinytypes.examples; public class DropwizardBootstrapTest { @Test public void canLoadYamlDWConfigFileWithTinyTypes() throws Exception { new TestApplication().run(new String[]{"server", ClassLoader.getSystemClassLoader().getResource("tts.yml").getPath().toString()}); } ...
// Path: tinytypes/src/test/java/tech/anima/tinytypes/Samples.java // public class Samples { // // public static class Integer extends IntTinyType { // // public Integer(int value) { // super(value); // } // // public static Integer of(int value) { // return new In...
private final Samples.Str stringValue;