001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.tools.sourceformatter;
016    
017    /**
018     * @author Carlos Sierra Andr??s
019     */
020    public class ImportPackage implements Comparable<ImportPackage> {
021    
022            @Override
023            public int compareTo(ImportPackage importPackage) {
024                    return _import.compareTo(importPackage._import);
025            }
026    
027            @Override
028            public boolean equals(Object obj) {
029                    if (this == obj) {
030                            return true;
031                    }
032    
033                    if (!(obj instanceof ImportPackage)) {
034                            return false;
035                    }
036    
037                    ImportPackage importPackage = (ImportPackage)obj;
038    
039                    return _import.equals(importPackage._import);
040            }
041    
042            public String getImport() {
043                    return _import;
044            }
045    
046            public String getLine() {
047                    return _line;
048            }
049    
050            @Override
051            public int hashCode() {
052                    return _import.hashCode();
053            }
054    
055            protected ImportPackage(String importString, String line) {
056                    _import = importString;
057                    _line = line;
058            }
059    
060            private String _import;
061            private String _line;
062    
063    }