java.lang.Integer.getInteger()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(341)

本文整理了Java中java.lang.Integer.getInteger()方法的一些代码示例,展示了Integer.getInteger()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Integer.getInteger()方法的具体详情如下:
包路径:java.lang.Integer
类名称:Integer
方法名:getInteger

Integer.getInteger介绍

[英]Returns the Integer value of the system property identified by string. Returns null if string is nullor empty, if the property can not be found or if its value can not be parsed as an integer.
[中]返回由字符串标识的系统属性的整数值。如果字符串为null或为空、找不到属性或无法将其值解析为整数,则返回null。

代码示例

代码示例来源:origin: springside/springside4

  1. /**
  2. * 读取Integer类型的系统变量,为空时返回null.
  3. */
  4. public static Integer getInteger(String name) {
  5. return Integer.getInteger(name);
  6. }

代码示例来源:origin: springside/springside4

  1. /**
  2. * 读取Integer类型的系统变量,为空时返回默认值
  3. */
  4. public static Integer getInteger(String name, Integer defaultValue) {
  5. return Integer.getInteger(name, defaultValue);
  6. }

代码示例来源:origin: apache/zookeeper

  1. public WatcherCleaner(IDeadWatcherListener listener) {
  2. this(listener,
  3. Integer.getInteger("zookeeper.watcherCleanThreshold", 1000),
  4. Integer.getInteger("zookeeper.watcherCleanIntervalInSeconds", 600),
  5. Integer.getInteger("zookeeper.watcherCleanThreadsNum", 2),
  6. Integer.getInteger("zookeeper.maxInProcessingDeadWatchers", -1));
  7. }

代码示例来源:origin: GoogleContainerTools/jib

  1. /**
  2. * Gets the HTTP connection/read timeouts for registry interactions in milliseconds. This is
  3. * defined by the {@code jib.httpTimeout} system property. The default value is 20000 if the
  4. * system property is not set, and 0 indicates an infinite timeout.
  5. *
  6. * @return the HTTP connection/read timeouts for registry interactions in milliseconds
  7. */
  8. public static int getHttpTimeout() {
  9. if (Integer.getInteger(HTTP_TIMEOUT) == null) {
  10. return 20000;
  11. }
  12. return Integer.getInteger(HTTP_TIMEOUT);
  13. }

代码示例来源:origin: real-logic/aeron

  1. /**
  2. * The value {@link #SERVICE_CONTROL_STREAM_ID_DEFAULT} or system property
  3. * {@link #SERVICE_STREAM_ID_PROP_NAME} if set.
  4. *
  5. * @return {@link #SERVICE_CONTROL_STREAM_ID_DEFAULT} or system property
  6. * {@link #SERVICE_STREAM_ID_PROP_NAME} if set.
  7. */
  8. public static int serviceStreamId()
  9. {
  10. return Integer.getInteger(SERVICE_STREAM_ID_PROP_NAME, SERVICE_CONTROL_STREAM_ID_DEFAULT);
  11. }

代码示例来源:origin: real-logic/aeron

  1. /**
  2. * The value {@link #EGRESS_STREAM_ID_DEFAULT} or system property
  3. * {@link #EGRESS_STREAM_ID_PROP_NAME} if set.
  4. *
  5. * @return {@link #EGRESS_STREAM_ID_DEFAULT} or system property
  6. * {@link #EGRESS_STREAM_ID_PROP_NAME} if set.
  7. */
  8. public static int egressStreamId()
  9. {
  10. return Integer.getInteger(EGRESS_STREAM_ID_PROP_NAME, EGRESS_STREAM_ID_DEFAULT);
  11. }
  12. }

代码示例来源:origin: real-logic/aeron

  1. /**
  2. * The value {@link #CLUSTER_MEMBER_ID_DEFAULT} or system property
  3. * {@link #CLUSTER_MEMBER_ID_PROP_NAME} if set.
  4. *
  5. * @return {@link #CLUSTER_MEMBER_ID_DEFAULT} or system property
  6. * {@link #CLUSTER_MEMBER_ID_PROP_NAME} if set.
  7. */
  8. public static int clusterMemberId()
  9. {
  10. return Integer.getInteger(CLUSTER_MEMBER_ID_PROP_NAME, CLUSTER_MEMBER_ID_DEFAULT);
  11. }

代码示例来源:origin: real-logic/aeron

  1. /**
  2. * The value {@link #SNAPSHOT_STREAM_ID_DEFAULT} or system property
  3. * {@link ClusteredServiceContainer.Configuration#SNAPSHOT_STREAM_ID_PROP_NAME} if set.
  4. *
  5. * @return {@link #SNAPSHOT_STREAM_ID_DEFAULT} or system property
  6. * {@link ClusteredServiceContainer.Configuration#SNAPSHOT_STREAM_ID_PROP_NAME} if set.
  7. */
  8. public static int snapshotStreamId()
  9. {
  10. return Integer.getInteger(SNAPSHOT_STREAM_ID_PROP_NAME, SNAPSHOT_STREAM_ID_DEFAULT);
  11. }

代码示例来源:origin: real-logic/aeron

  1. /**
  2. * The value {@link #SERVICE_ID_DEFAULT} or system property {@link #SERVICE_ID_PROP_NAME} if set.
  3. *
  4. * @return {@link #SERVICE_ID_DEFAULT} or system property {@link #SERVICE_ID_PROP_NAME} if set.
  5. */
  6. public static int serviceId()
  7. {
  8. return Integer.getInteger(SERVICE_ID_PROP_NAME, SERVICE_ID_DEFAULT);
  9. }

代码示例来源:origin: real-logic/aeron

  1. /**
  2. * The value {@link #APPOINTED_LEADER_ID_DEFAULT} or system property
  3. * {@link #APPOINTED_LEADER_ID_PROP_NAME} if set.
  4. *
  5. * @return {@link #APPOINTED_LEADER_ID_DEFAULT} or system property
  6. * {@link #APPOINTED_LEADER_ID_PROP_NAME} if set.
  7. */
  8. public static int appointedLeaderId()
  9. {
  10. return Integer.getInteger(APPOINTED_LEADER_ID_PROP_NAME, APPOINTED_LEADER_ID_DEFAULT);
  11. }

代码示例来源:origin: real-logic/aeron

  1. /**
  2. * The value {@link #LOCAL_CONTROL_STREAM_ID_DEFAULT} or system property
  3. * {@link #LOCAL_CONTROL_STREAM_ID_PROP_NAME} if set.
  4. *
  5. * @return {@link #LOCAL_CONTROL_STREAM_ID_DEFAULT} or system property
  6. * {@link #LOCAL_CONTROL_STREAM_ID_PROP_NAME} if set.
  7. */
  8. public static int localControlStreamId()
  9. {
  10. return Integer.getInteger(LOCAL_CONTROL_STREAM_ID_PROP_NAME, LOCAL_CONTROL_STREAM_ID_DEFAULT);
  11. }

代码示例来源:origin: real-logic/aeron

  1. /**
  2. * The value {@link #CONSENSUS_MODULE_STREAM_ID_DEFAULT} or system property
  3. * {@link #CONSENSUS_MODULE_STREAM_ID_PROP_NAME} if set.
  4. *
  5. * @return {@link #CONSENSUS_MODULE_STREAM_ID_DEFAULT} or system property
  6. * {@link #CONSENSUS_MODULE_STREAM_ID_PROP_NAME} if set.
  7. */
  8. public static int consensusModuleStreamId()
  9. {
  10. return Integer.getInteger(CONSENSUS_MODULE_STREAM_ID_PROP_NAME, CONSENSUS_MODULE_STREAM_ID_DEFAULT);
  11. }

代码示例来源:origin: real-logic/aeron

  1. /**
  2. * The value {@link #INGRESS_STREAM_ID_DEFAULT} or system property
  3. * {@link #INGRESS_STREAM_ID_PROP_NAME} if set.
  4. *
  5. * @return {@link #INGRESS_STREAM_ID_DEFAULT} or system property
  6. * {@link #INGRESS_STREAM_ID_PROP_NAME} if set.
  7. */
  8. public static int ingressStreamId()
  9. {
  10. return Integer.getInteger(INGRESS_STREAM_ID_PROP_NAME, INGRESS_STREAM_ID_DEFAULT);
  11. }

代码示例来源:origin: real-logic/aeron

  1. /**
  2. * The value {@link #SERVICE_COUNT_DEFAULT} or system property
  3. * {@link #SERVICE_COUNT_PROP_NAME} if set.
  4. *
  5. * @return {@link #SERVICE_COUNT_DEFAULT} or system property
  6. * {@link #SERVICE_COUNT_PROP_NAME} if set.
  7. */
  8. public static int serviceCount()
  9. {
  10. return Integer.getInteger(SERVICE_COUNT_PROP_NAME, SERVICE_COUNT_DEFAULT);
  11. }

代码示例来源:origin: real-logic/aeron

  1. /**
  2. * The value {@link #MEMBER_STATUS_STREAM_ID_DEFAULT} or system property
  3. * {@link #MEMBER_STATUS_STREAM_ID_PROP_NAME} if set.
  4. *
  5. * @return {@link #MEMBER_STATUS_STREAM_ID_DEFAULT} or system property
  6. * {@link #MEMBER_STATUS_STREAM_ID_PROP_NAME} if set.
  7. */
  8. public static int memberStatusStreamId()
  9. {
  10. return Integer.getInteger(MEMBER_STATUS_STREAM_ID_PROP_NAME, MEMBER_STATUS_STREAM_ID_DEFAULT);
  11. }
  12. }

代码示例来源:origin: apache/zookeeper

  1. public JettyAdminServer() throws AdminServerException {
  2. this(System.getProperty("zookeeper.admin.serverAddress", DEFAULT_ADDRESS),
  3. Integer.getInteger("zookeeper.admin.serverPort", DEFAULT_PORT),
  4. Integer.getInteger("zookeeper.admin.idleTimeout", DEFAULT_IDLE_TIMEOUT),
  5. System.getProperty("zookeeper.admin.commandURL", DEFAULT_COMMAND_URL));
  6. }

代码示例来源:origin: eclipse-vertx/vert.x

  1. private int getClusterPublicPort(EventBusOptions options, int actualPort) {
  2. // We retain the old system property for backwards compat
  3. int publicPort = Integer.getInteger(CLUSTER_PUBLIC_PORT_PROP_NAME, options.getClusterPublicPort());
  4. if (publicPort == -1) {
  5. // Get the actual port, wildcard port of zero might have been specified
  6. publicPort = actualPort;
  7. }
  8. return publicPort;
  9. }

代码示例来源:origin: apache/zookeeper

  1. private synchronized void setupContainerManager() {
  2. containerManager = new ContainerManager(getZKDatabase(), prepRequestProcessor,
  3. Integer.getInteger("znode.container.checkIntervalMs", (int) TimeUnit.MINUTES.toMillis(1)),
  4. Integer.getInteger("znode.container.maxPerMinute", 10000)
  5. );
  6. }

代码示例来源:origin: neo4j/neo4j

  1. /**
  2. * Get the value of a {@code int} system property.
  3. *
  4. * The absolute name of the system property is computed based on the provided class and local name.
  5. *
  6. * @param location the class that owns the flag.
  7. * @param name the local name of the flag.
  8. * @param defaultValue the default value of the flag if the system property is not assigned.
  9. * @return the parsed value of the system property, or the default value.
  10. */
  11. public static int getInteger( Class<?> location, String name, int defaultValue )
  12. {
  13. return Integer.getInteger( name( location, name ), defaultValue );
  14. }

代码示例来源:origin: prestodb/presto

  1. public static void main(String[] args)
  2. throws RunnerException
  3. {
  4. Options options = new OptionsBuilder()
  5. .verbosity(VerboseMode.NORMAL)
  6. .threads(getInteger("threads", 1))
  7. .include(".*" + BenchmarkCPUCounters.class.getSimpleName() + ".*")
  8. .build();
  9. new Runner(options).run();
  10. }
  11. }

相关文章