All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.archaius.PropertyContainer Maven / Gradle / Ivy

There is a newer version: 2.0.0-rc.7
Show newest version
/**
 * Copyright 2015 Netflix, Inc.
 *
 * 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 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.
 */
package com.netflix.archaius;

import java.math.BigDecimal;
import java.math.BigInteger;

public interface PropertyContainer {
    
    /**
     * Notify the container that it should fetch the latest property value
     */
    void update();
    
    /**
     * Parse the property as a string 
     */
    Property asString(String defaultValue);
    
    /**
     * Parse the property as an int 
     */
    Property asInteger(Integer defaultValue);
    
    /**
     * Parse the property as a Long 
     */
    Property asLong(Long defaultValue);
    
    /**
     * Parse the property as a double 
     */
    Property asDouble(Double defaultValue);
    
    /**
     * Parse the property as a float 
     */
    Property asFloat(Float defaultValue);
    
    /**
     * Parse the property as a short 
     */
    Property asShort(Short defaultValue);
    
    /**
     * Parse the property as a byte 
     */
    Property asByte(Byte defaultValue);
    
    /**
     * Parse the property as a boolean 
     */
    Property asBoolean(Boolean defaultValue);

    /**
     * Parse the property as a BigDecimal 
     */
    Property asBigDecimal(BigDecimal defaultValue);

    /**
     * Parse the property as a BigInteger 
     */
    Property asBigInteger(BigInteger defaultValue);
    
    /**
     * Custom parsing based on the provided type.  An implementation of ObservableProperty 
     * should be optimized to call one of the known parsing methods based on type. 
     */
     Property asType(Class type, T defaultValue);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy