Java Properties Get getLong(Properties props, String string, long defaultV)

Here you can find the source of getLong(Properties props, String string, long defaultV)

Description

get Long

License

Apache License

Declaration

public static long getLong(Properties props, String string, long defaultV) 

Method Source Code

//package com.java2s;
/**//from  w  w w. j  a  v a2s. c o m
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.util.*;

public class Main {
    public static long getLong(Properties props, String string, long defaultV) {
        if (props.containsKey(string)) {
            return Long.valueOf(props.getProperty(string));
        }
        return defaultV;
    }
}

Related

  1. getIntersectionOfPropertyValues(Properties propertyFileOne, Properties propertyFileTwo)
  2. getIntInRange(Properties props, String name, int defaultValue, int min, int max)
  3. getIntProperty(Properties props, String keyword, int defaultValue)
  4. getIsB37PropertyValue(final Properties dataSourceProperties)
  5. getLocalizedProperties(String[] propertyKeys, Properties properties)
  6. getNestedProperties(String prefix, Properties properties)
  7. getProp(Properties props, String name)
  8. getPropertiesForBloomFilter( int requiredFieldsSize, int matchKeySize)
  9. getPropertiesWithPrefix(Properties pro, String prefix)