001/*
002 * Copyright (c) 2004, Codehaus.org
003 *
004 * Permission is hereby granted, free of charge, to any person obtaining a copy of
005 * this software and associated documentation files (the "Software"), to deal in
006 * the Software without restriction, including without limitation the rights to
007 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
008 * of the Software, and to permit persons to whom the Software is furnished to do
009 * so, subject to the following conditions:
010 *
011 * The above copyright notice and this permission notice shall be included in all
012 * copies or substantial portions of the Software.
013 *
014 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020 * SOFTWARE.
021 */
022
023package org.codehaus.modello;
024
025import java.util.Properties;
026import java.util.Set;
027import java.util.TreeSet;
028
029/**
030 * A Properties class with predictable order: it is sorted by key value. This class is not really fully consistent,
031 * but sufficiently for Modello unit-tests when reading/writing XML samples.
032 *
033 * @author Hervé Boutemy
034 */
035public class OrderedProperties
036    extends Properties
037{
038    private static final long serialVersionUID = 4578458610736378768L;
039
040    public Set<Object> keySet()
041    {
042        return new TreeSet<Object>( super.keySet() );
043    }
044}