Home | History | Annotate | Download | only in vo
      1 /*
      2  * Copyright 2017 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package androidx.room.integration.testapp.vo;
     18 
     19 
     20 public class NameAndLastName {
     21     private String mName;
     22     private String mLastName;
     23 
     24     public NameAndLastName(String name, String lastName) {
     25         mName = name;
     26         mLastName = lastName;
     27     }
     28 
     29     public String getName() {
     30         return mName;
     31     }
     32 
     33     public String getLastName() {
     34         return mLastName;
     35     }
     36 
     37     @SuppressWarnings("SimplifiableIfStatement")
     38     @Override
     39     public boolean equals(Object o) {
     40         if (this == o) return true;
     41         if (o == null || getClass() != o.getClass()) return false;
     42 
     43         NameAndLastName that = (NameAndLastName) o;
     44 
     45         if (mName != null ? !mName.equals(that.mName) : that.mName != null) return false;
     46         return mLastName != null ? mLastName.equals(that.mLastName) : that.mLastName == null;
     47     }
     48 
     49     @Override
     50     public int hashCode() {
     51         int result = mName != null ? mName.hashCode() : 0;
     52         result = 31 * result + (mLastName != null ? mLastName.hashCode() : 0);
     53         return result;
     54     }
     55 }
     56