Ignore:
Timestamp:
2017-04-22T15:23:07+02:00 (7 years ago)
Author:
Don-vip
Message:

add unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/Filter.java

    r10378 r11973  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.osm;
     3
     4import java.util.Objects;
    35
    46import org.openstreetmap.josm.actions.search.SearchAction.SearchMode;
     
    114116        @writeExplicitly
    115117        @pref public boolean inverted;
     118
     119        @Override
     120        public int hashCode() {
     121            return Objects.hash(case_sensitive, enable, hiding, inverted, mapCSS_search, mode, regex_search, text, version);
     122        }
     123
     124        @Override
     125        public boolean equals(Object obj) {
     126            if (this == obj)
     127                return true;
     128            if (obj == null || getClass() != obj.getClass())
     129                return false;
     130            FilterPreferenceEntry other = (FilterPreferenceEntry) obj;
     131            return case_sensitive == other.case_sensitive
     132                    && enable == other.enable
     133                    && hiding == other.hiding
     134                    && inverted == other.inverted
     135                    && mapCSS_search == other.mapCSS_search
     136                    && regex_search == other.regex_search
     137                    && Objects.equals(mode, other.mode)
     138                    && Objects.equals(text, other.text)
     139                    && Objects.equals(version, other.version);
     140        }
    116141    }
    117142
Note: See TracChangeset for help on using the changeset viewer.