001 /*
002 * Copyright 2001-2010 Stephen Colebourne
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.joda.beans;
017
018 /**
019 * Utility methods for working with beans.
020 *
021 * @author Stephen Colebourne
022 */
023 public final class Beans {
024
025 /**
026 * Restricted constructor.
027 */
028 private Beans() {
029 }
030
031 //-------------------------------------------------------------------------
032 // /**
033 // * Converts a property name to a capitalized property name.
034 // * @param name the name to capitalize, not null
035 // * @return the capitalized name, never null
036 // */
037 // public static String capitalize(String name) {
038 // if (name.length() == 0) {
039 // return name;
040 // }
041 // return name.substring(0, 1).toUpperCase(ENGLISH) + name.substring(1);
042 // }
043 //
044 // //-----------------------------------------------------------------------
045 // /**
046 // * Gets the contents of the specified bean converted to a modifiable {@code HashMap}.
047 // * <p>
048 // * The returned map will contain
049 // *
050 // * @return the modifiable map of property objects, never null
051 // */
052 // public static <B> Map<String, Object> toMap(Bean<B> bean) {
053 // Map<String, Property<B, Object>> propertyMap = bean.propertyMap();
054 // Map<String, Object> map = new HashMap<String, Object>(propertyMap.size());
055 // for (Entry<String, Property<B, Object>> entry : propertyMap.entrySet()) {
056 // map.put(entry.getKey(), entry.getValue().get());
057 // }
058 // return map;
059 // }
060
061 }