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

org.echocat.jemoni.jmx.AttributeDefinition Maven / Gradle / Ivy

There is a newer version: 0.1.11
Show newest version
/*****************************************************************************************
 * *** BEGIN LICENSE BLOCK *****
 *
 * Version: MPL 2.0
 *
 * echocat JeMoni, Copyright (c) 2012 echocat
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * *** END LICENSE BLOCK *****
 ****************************************************************************************/

package org.echocat.jemoni.jmx;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public interface AttributeDefinition extends MemberDefinition {

    @Nonnull
    public Class getType();

    @Nonnull
    public AccessMode getAccessMode();

    public void set(@Nonnull B bean, @Nullable T value) throws Exception;

    @Nullable
    public T get(@Nonnull B bean) throws Exception;

    public enum AccessMode {
        undefined(false, false),
        readOnly(true, false),
        writeOnly(false, true),
        readWrite(true, true);

        private final boolean _readingPossible;
        private final boolean _writingPossible;

        private AccessMode(boolean readingPossible, boolean writingPossible) {
            _writingPossible = writingPossible;
            _readingPossible = readingPossible;
        }

        public boolean isReadingPossible() {
            return _readingPossible;
        }

        public boolean isWritingPossible() {
            return _writingPossible;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy