001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.search;
016    
017    import java.util.ArrayList;
018    import java.util.List;
019    import java.util.Locale;
020    import java.util.Map;
021    
022    /**
023     * @author Miguel Angelo Caldas Gallindo
024     *
025     */
026    public class FieldArray extends Field {
027    
028            public FieldArray(String name) {
029                    super(name);
030            }
031    
032            public FieldArray(String name, Map<Locale, String> localizedValues) {
033                    super(name, localizedValues);
034            }
035    
036            public FieldArray(String name, String value) {
037                    super(name, value);
038            }
039    
040            public FieldArray(String name, String[] values) {
041                    super(name, values);
042            }
043    
044            @Override
045            public void addField(Field field) {
046                    _fields.add(field);
047            }
048    
049            @Override
050            public List<Field> getFields() {
051                    return _fields;
052            }
053    
054            @Override
055            public boolean isArray() {
056                    return true;
057            }
058    
059            private final List<Field> _fields = new ArrayList<Field>();
060    
061    }