001    package nl.tudelft.tbm.eeni.owl2java.model.jmodel;
002    
003    import nl.tudelft.tbm.eeni.owl2java.utils.IName;
004    import nl.tudelft.tbm.eeni.owl2java.utils.IReporting;
005    import nl.tudelft.tbm.eeni.owl2java.utils.StringUtils;
006    import org.apache.commons.logging.Log;
007    import org.apache.commons.logging.LogFactory;
008    
009    
010    public class JMapped implements IReporting, IName {
011    
012        private static Log log = LogFactory.getLog(JMapped.class);
013    
014        private String name;
015        private String comment;
016        private String mapUri;
017    
018        public JMapped(String name, String mappedTo) {
019            assert mappedTo != null;
020            this.name = name;
021            this.mapUri = mappedTo;
022        }
023    
024        public String getJModelReport() {
025            log.warn("JMapped.toReport not implemented");
026            return null;
027        }
028    
029        public String getName() {
030            return name;
031        }
032    
033        public String getComment() {
034            return comment;
035        }
036    
037        public void setComment(String comment) {
038            this.comment = comment;
039        }
040    
041        public String getMapUri() {
042            return mapUri;
043        }
044    
045        public String getJavaNameCaps() {
046            return StringUtils.toFirstUpperCase(getName());
047        }
048    
049        public boolean equals(Object other) {
050            // both instance of JMapped and Same MapUri
051            return other instanceof JMapped && (((JMapped) other).getMapUri().equals(getMapUri()));
052        }
053    
054        public int hashCode() {
055            int hash = 12;
056            hash = hash + mapUri.hashCode();
057            return hash;
058        }
059    
060    }