List of usage examples for com.google.common.collect ImmutableList of
public static <E> ImmutableList<E> of(E e1, E e2, E e3)
From source file:com.google.javascript.jscomp.ModulesTestUtils.java
static void testModules(CompilerTestCase test, String fileName, String input, String expected) { // Shared with ProcessCommonJSModulesTest. ImmutableList<SourceFile> inputs = ImmutableList.of( SourceFile.fromCode("other.js", "goog.provide('module$other');"), SourceFile.fromCode("yet_another.js", "goog.provide('module$yet_another');"), SourceFile.fromCode(fileName, input)); ImmutableList<SourceFile> expecteds = ImmutableList.of( SourceFile.fromCode("other.js", "goog.provide('module$other');"), SourceFile.fromCode("yet_another.js", "goog.provide('module$yet_another');"), SourceFile.fromCode(fileName, expected)); test.test(inputs, expecteds);/* www.j a v a 2 s. c om*/ }
From source file:org.jbpm.workbench.ht.client.util.TaskUtils.java
public static List<TaskStatus> getTaskStatusByType(TaskType type) { ImmutableList<TaskStatus> status = null; switch (type) { case ACTIVE: status = ImmutableList.of(TASK_STATUS_READY, TASK_STATUS_RESERVED, TASK_STATUS_IN_PROGRESS); break;//w w w . jav a 2 s . c om case GROUP: status = ImmutableList.of(TASK_STATUS_READY); break; case ALL: status = ImmutableList.of(TASK_STATUS_CREATED, TASK_STATUS_READY, TASK_STATUS_RESERVED, TASK_STATUS_IN_PROGRESS, TASK_STATUS_SUSPENDED, TASK_STATUS_FAILED, TASK_STATUS_ERROR, TASK_STATUS_EXITED, TASK_STATUS_OBSOLETE, TASK_STATUS_COMPLETED); break; case PERSONAL: status = ImmutableList.of(TASK_STATUS_IN_PROGRESS, TASK_STATUS_CREATED, TASK_STATUS_RESERVED); break; case ADMIN: status = ImmutableList.of(TASK_STATUS_READY, TASK_STATUS_IN_PROGRESS, TASK_STATUS_CREATED, TASK_STATUS_RESERVED, TASK_STATUS_SUSPENDED); break; default: throw new IllegalStateException("Unrecognized view type '" + type + "'!"); } return Lists.newArrayList(status); }
From source file:org.sonar.core.config.SecurityProperties.java
static List<PropertyDefinition> all() { return ImmutableList.of( PropertyDefinition.builder(CoreProperties.CORE_ALLOW_USERS_TO_SIGNUP_PROPERTY) .defaultValue(Boolean.toString(CoreProperties.CORE_ALLOW_USERS_TO_SIGNUP_DEAULT_VALUE)) .name("Activate sign up for local account") .description(/*from ww w .j a va 2s. co m*/ "Allow users to sign up online for a local account. For that purpose, a \"Sign Up\" link will be available in the \"Login\" page.") .type(PropertyType.BOOLEAN).category(CoreProperties.CATEGORY_SECURITY).build(), PropertyDefinition.builder(CoreProperties.CORE_DEFAULT_GROUP) .defaultValue(CoreProperties.CORE_DEFAULT_GROUP_DEFAULT_VALUE).name("Default user group") .description("Any new users will automatically join this group.") .category(CoreProperties.CATEGORY_SECURITY).build(), PropertyDefinition.builder(CoreProperties.CORE_FORCE_AUTHENTICATION_PROPERTY) .defaultValue(Boolean.toString(CoreProperties.CORE_FORCE_AUTHENTICATION_DEFAULT_VALUE)) .name("Force user authentication") .description("Forcing user authentication stops un-logged users to access SonarQube.") .type(PropertyType.BOOLEAN).category(CoreProperties.CATEGORY_SECURITY).build()); }
From source file:org.sonar.plugins.surefire.SurefireExtensions.java
public static List getExtensions() { return ImmutableList.of(PropertyDefinition.builder(SurefireUtils.SUREFIRE_REPORTS_PATH_PROPERTY) .name("JUnit Reports") .description(//from w ww . ja v a 2 s .c o m "Path to the directory containing all the *.xml JUnit report files. The path may be absolute or relative to the project base directory.") .onQualifiers(Qualifiers.PROJECT).category(JavaConstants.JAVA_CATEGORY).subCategory("JUnit") .build(), SurefireSensor.class, SurefireJavaParser.class); }
From source file:com.spectralogic.ds3autogen.testutil.Ds3AnnotationMarshaledNameFixture.java
public static Ds3Annotation createCustomMarshaledNameAnnotation() { return new Ds3Annotation("com.spectralogic.util.marshal.CustomMarshaledName", ImmutableList.of( new Ds3AnnotationElement("CollectionValue", "TestCollectionValue", "java.lang.String"), new Ds3AnnotationElement("CollectionValueRenderingMode", "UNDEFINED", "com.spectralogic.util.marshal.CustomMarshaledName$CollectionNameRenderingMode"), new Ds3AnnotationElement("Value", "Error", "java.lang.String"))); }
From source file:org.sonar.core.config.DebtProperties.java
static List<PropertyDefinition> all() { return ImmutableList.of(PropertyDefinition.builder(CoreProperties.DEVELOPMENT_COST) .defaultValue("" + CoreProperties.DEVELOPMENT_COST_DEF_VALUE).name("Development cost") .description(// w w w .ja v a 2 s .co m "Cost to develop one line of code (LOC). Example: if the cost to develop 1 LOC has been estimated " + "at 30 minutes, then the value of this property would be 30.") .category(CoreProperties.CATEGORY_TECHNICAL_DEBT).deprecatedKey("workUnitsBySizePoint").build(), PropertyDefinition.builder(CoreProperties.RATING_GRID) .defaultValue("" + CoreProperties.RATING_GRID_DEF_VALUES) .name("Maintainability rating grid") .description( "Maintainability ratings range from A (very good) to E (very bad). The rating is determined by the value of " + "the Technical Debt Ratio, which compares the technical debt on a project to the cost it would take to rewrite " + "the code from scratch. The default values for A through D are 0.05,0.1,0.2,0.5. Anything over 0.5 is an E. " + "Example: assuming the development cost is 30 minutes, a project with a technical debt of 24,000 minutes for " + "2,500 LOC will have a technical debt ratio of 24000/(30 * 2,500) = 0.32. That yields a maintainability rating of D.") .category(CoreProperties.CATEGORY_TECHNICAL_DEBT).deprecatedKey("ratingGrid").build(), PropertyDefinition.builder(CoreProperties.LANGUAGE_SPECIFIC_PARAMETERS) .name("Language specific parameters") .description( "The parameters specified here for a given language will override the general parameters defined in this section.") .category(CoreProperties.CATEGORY_TECHNICAL_DEBT) .deprecatedKey("languageSpecificParameters") .fields(PropertyFieldDefinition .build(CoreProperties.LANGUAGE_SPECIFIC_PARAMETERS_LANGUAGE_KEY) .name("Language Key").description("Ex: java, cs, cpp...").type(PropertyType.STRING) .build(), PropertyFieldDefinition .build(CoreProperties.LANGUAGE_SPECIFIC_PARAMETERS_MAN_DAYS_KEY) .name("Development cost") .description( "If left blank, the generic value defined in this section will be used.") .type(PropertyType.FLOAT).build()) .build()); }
From source file:org.apache.jackrabbit.oak.plugins.commit.JcrConflictHandler.java
/** * The conflict handler is a composite of {@link ChildOrderConflictHandler} * and {@link AnnotatingConflictHandler}. *///from w w w . j a v a 2 s. c o m public static CompositeConflictHandler createJcrConflictHandler() { return new CompositeConflictHandler(ImmutableList.of(new JcrLastModifiedConflictHandler(), new ChildOrderConflictHandler(), new AnnotatingConflictHandler())); }
From source file:io.github.zerthick.mailboxes.util.config.sql.SQLDataUtil.java
public static void createMailboxLocationsTable(Logger logger) { List<String> columns = ImmutableList.of("WORLD_ID UUID", "LOCATION VARCHAR", "PRIMARY KEY (WORLD_ID, LOCATION)"); try {/* w w w .j av a 2s. c o m*/ SQLUtil.createTable("MAILBOX_LOCATIONS", columns); } catch (SQLException e) { logger.error(e.getMessage()); } }
From source file:org.sonar.core.config.TelemetryProperties.java
public static List<PropertyDefinition> all() { return ImmutableList.of(PropertyDefinition.builder(PROP_ENABLE).defaultValue(Boolean.toString(true)) .type(PropertyType.BOOLEAN).name("Share SonarQube statistics") .description(/* ww w. j a v a 2 s . c o m*/ "By sharing anonymous SonarQube statistics, you help us understand how SonarQube is used so we can improve the plugin to work even better for you. " + "We don't collect source code or IP addresses. And we don't share the data with anyone else.") .hidden().build(), PropertyDefinition.builder(PROP_FREQUENCY) // 6 hours in seconds .defaultValue("21600").type(PropertyType.INTEGER) .name("Frequency of telemetry checks, in seconds").hidden().build(), PropertyDefinition.builder(PROP_URL).defaultValue("https://telemetry.sonarsource.com/sonarqube") .type(PropertyType.STRING).name("URL where telemetry data is sent").hidden().build()); }
From source file:org.garethaye.minimax.tic_tac_toe.TicTacToeClient.java
public static List<List<Integer>> getBoard() { List<List<Integer>> board = new LinkedList<List<Integer>>(); board.add(ImmutableList.of(1, 1, 2)); board.add(ImmutableList.of(1, 2, 0)); board.add(ImmutableList.of(1, 2, 2)); return board; }