Java Properties Get getIsB37PropertyValue(final Properties dataSourceProperties)

Here you can find the source of getIsB37PropertyValue(final Properties dataSourceProperties)

Description

Get if the properties has specified the `isB37` field #CONFIG_FILE_FIELD_NAME_IS_B37_DATA_SOURCE as true.

License

Open Source License

Parameter

Parameter Description
dataSourceProperties Properties object from which to read the setting.

Return

The value of the property. If absent, false .

Declaration

private static boolean getIsB37PropertyValue(final Properties dataSourceProperties) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static final String CONFIG_FILE_FIELD_NAME_IS_B37_DATA_SOURCE = "isB37DataSource";

    /**//from ww w.  j a  v a 2  s  .  co  m
     * Get if the properties has specified the `isB37` field {@link #CONFIG_FILE_FIELD_NAME_IS_B37_DATA_SOURCE} as true.
     * If it is absent, it will default to {@code false}.
     * @param dataSourceProperties {@link Properties} object from which to read the setting.
     * @return The value of the {@link #CONFIG_FILE_FIELD_NAME_IS_B37_DATA_SOURCE} property.  If absent, {@code false}.
     */
    private static boolean getIsB37PropertyValue(final Properties dataSourceProperties) {
        if (dataSourceProperties.containsKey(CONFIG_FILE_FIELD_NAME_IS_B37_DATA_SOURCE)) {
            return Boolean.valueOf(
                    dataSourceProperties.getProperty(CONFIG_FILE_FIELD_NAME_IS_B37_DATA_SOURCE).replace(" ", ""));
        }
        return false;
    }
}

Related

  1. getInt(Properties props, String name)
  2. getInt(Properties props, String name, int defaultValue)
  3. getIntersectionOfPropertyValues(Properties propertyFileOne, Properties propertyFileTwo)
  4. getIntInRange(Properties props, String name, int defaultValue, int min, int max)
  5. getIntProperty(Properties props, String keyword, int defaultValue)
  6. getLocalizedProperties(String[] propertyKeys, Properties properties)
  7. getLong(Properties props, String string, long defaultV)
  8. getNestedProperties(String prefix, Properties properties)
  9. getProp(Properties props, String name)