001 /*
002 * JBoss, Home of Professional Open Source.
003 * Copyright 2008, Red Hat Middleware LLC, and individual contributors
004 * as indicated by the @author tags. See the copyright.txt file in the
005 * distribution for a full listing of individual contributors.
006 *
007 * This is free software; you can redistribute it and/or modify it
008 * under the terms of the GNU Lesser General Public License as
009 * published by the Free Software Foundation; either version 2.1 of
010 * the License, or (at your option) any later version.
011 *
012 * This software is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * You should have received a copy of the GNU Lesser General Public
018 * License along with this software; if not, write to the Free
019 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021 */
022 package org.jboss.dna.graph.properties;
023
024 import java.util.Iterator;
025
026 /**
027 * @author Randall Hauch
028 */
029 public interface PropertyFactory {
030 /**
031 * Create a property with the supplied name and values
032 *
033 * @param name the property name; may not be null
034 * @param values the values
035 * @return the resulting property
036 */
037 Property create( Name name,
038 Object... values );
039
040 /**
041 * Create a property with the supplied name and values
042 *
043 * @param name the property name; may not be null
044 * @param values the values
045 * @return the resulting property
046 */
047 Property create( Name name,
048 Iterable<?> values );
049
050 /**
051 * Create a property with the supplied name and values
052 *
053 * @param name the property name; may not be null
054 * @param values the values
055 * @return the resulting property
056 */
057 Property create( Name name,
058 Iterator<?> values );
059
060 /**
061 * Create a property with the supplied name and values
062 *
063 * @param name the property name; may not be null
064 * @param desiredType the type that the objects should be converted to; if null, they will be used as is
065 * @param values the values
066 * @return the resulting property
067 */
068 Property create( Name name,
069 PropertyType desiredType,
070 Object... values );
071
072 /**
073 * Create a property with the supplied name and values
074 *
075 * @param name the property name; may not be null
076 * @param desiredType the type that the objects should be converted to; if null, they will be used as is
077 * @param values the values
078 * @return the resulting property
079 */
080 Property create( Name name,
081 PropertyType desiredType,
082 Iterable<?> values );
083
084 /**
085 * Create a property with the supplied name and values
086 *
087 * @param name the property name; may not be null
088 * @param desiredType the type that the objects should be converted to; if null, they will be used as is
089 * @param values the values
090 * @return the resulting property
091 */
092 Property create( Name name,
093 PropertyType desiredType,
094 Iterator<?> values );
095
096 }