Ignore:
Timestamp:
08/29/12 10:05:50 (12 years ago)
Author:
sherbold
Message:
  • added getStringIdentifier() to interface IEventTarget
  • all event types and targets now implement equals and hashCode
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/quest-plugin-php/src/main/java/de/ugoe/cs/quest/plugin/php/eventcore/PHPEventType.java

    r655 r681  
     1 
    12package de.ugoe.cs.quest.plugin.php.eventcore; 
    23 
     
    2728     * </p> 
    2829     */ 
    29     private String path; 
     30    private final String path; 
    3031 
    3132    /** 
     
    3435     * </p> 
    3536     */ 
    36     private List<String> postVars; 
     37    private final List<String> postVars; 
    3738 
    3839    /** 
     
    4142     * </p> 
    4243     */ 
    43     private List<String> getVars; 
     44    private final List<String> getVars; 
    4445 
    4546    /** 
     
    8990    } 
    9091 
     92    /* 
     93     * (non-Javadoc) 
     94     *  
     95     * @see java.lang.Object#equals(java.lang.Object) 
     96     */ 
     97    @Override 
     98    public boolean equals(Object obj) { 
     99        if (obj instanceof PHPEventType) { 
     100            PHPEventType other = (PHPEventType) obj; 
     101            return ((path == null && other.path == null) || path.equals(other.path)) && 
     102                ((postVars == null && other.postVars == null) || postVars.equals(other.postVars)) && 
     103                ((getVars == null && other.getVars == null) || getVars.equals(other.getVars)); 
     104        } 
     105        return false; 
     106    } 
     107 
     108    /* 
     109     * (non-Javadoc) 
     110     *  
     111     * @see java.lang.Object#hashCode() 
     112     */ 
     113    @Override 
     114    public int hashCode() { 
     115        int hash = 17; 
     116        int multiplier = 7; 
     117        if (path != null) { 
     118            hash = hash * multiplier + path.hashCode(); 
     119        } 
     120        if (postVars != null) { 
     121            hash = hash * multiplier + postVars.hashCode(); 
     122        } 
     123        if (getVars != null) { 
     124            hash = hash * multiplier + getVars.hashCode(); 
     125        } 
     126        return hash; 
     127    } 
     128 
    91129} 
Note: See TracChangeset for help on using the changeset viewer.