001/* 002 * (C) Copyright 2015 Nuxeo SA (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl-2.1.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Florent Guillaume 016 */ 017package org.nuxeo.ecm.core.storage; 018 019import org.nuxeo.ecm.core.api.PropertyException; 020 021/** 022 * Basic interface to get/put simple values or arrays from a state object. 023 * 024 * @since 7.3 025 */ 026public interface StateAccessor { 027 028 /** 029 * Gets a single value. 030 * 031 * @param name the name 032 * @return the value 033 */ 034 Object getSingle(String name) throws PropertyException; 035 036 /** 037 * Gets an array value. 038 * 039 * @param name the name 040 * @return the value 041 */ 042 Object[] getArray(String name) throws PropertyException; 043 044 /** 045 * Sets a single value. 046 * 047 * @param name the name 048 * @param value the value 049 */ 050 void setSingle(String name, Object value) throws PropertyException; 051 052 /** 053 * Sets an array value. 054 * 055 * @param name the name 056 * @param value the value 057 */ 058 void setArray(String name, Object[] value) throws PropertyException; 059 060}