Home | History | Annotate | Download | only in support
      1 /*
      2  * Copyright (C) 2018 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 
     18 
     19 package com.google.android.tv.partner.support;
     20 
     21 import android.support.annotation.Nullable;
     22 import java.util.List;
     23 
     24 /**
     25  * Hand copy of generated Autovalue class.
     26  *
     27  * TODO get autovalue working
     28  */
     29 
     30 final class AutoValue_Lineup extends Lineup {
     31 
     32     private final String id;
     33     private final int type;
     34     private final String name;
     35     private final List<String> channels;
     36 
     37     AutoValue_Lineup(
     38             String id,
     39             int type,
     40             @Nullable String name,
     41             List<String> channels) {
     42         if (id == null) {
     43             throw new NullPointerException("Null id");
     44         }
     45         this.id = id;
     46         this.type = type;
     47         this.name = name;
     48         if (channels == null) {
     49             throw new NullPointerException("Null channels");
     50         }
     51         this.channels = channels;
     52     }
     53 
     54     @Override
     55     public String getId() {
     56         return id;
     57     }
     58 
     59     @Override
     60     public int getType() {
     61         return type;
     62     }
     63 
     64     @Nullable
     65     @Override
     66     public String getName() {
     67         return name;
     68     }
     69 
     70     @Override
     71     public List<String> getChannels() {
     72         return channels;
     73     }
     74 
     75     @Override
     76     public String toString() {
     77         return "Lineup{"
     78                 + "id=" + id + ", "
     79                 + "type=" + type + ", "
     80                 + "name=" + name + ", "
     81                 + "channels=" + channels
     82                 + "}";
     83     }
     84 
     85     @Override
     86     public boolean equals(Object o) {
     87         if (o == this) {
     88             return true;
     89         }
     90         if (o instanceof Lineup) {
     91             Lineup that = (Lineup) o;
     92             return (this.id.equals(that.getId()))
     93                     && (this.type == that.getType())
     94                     && ((this.name == null) ? (that.getName() == null) : this.name.equals(that.getName()))
     95                     && (this.channels.equals(that.getChannels()));
     96         }
     97         return false;
     98     }
     99 
    100     @Override
    101     public int hashCode() {
    102         int h$ = 1;
    103         h$ *= 1000003;
    104         h$ ^= id.hashCode();
    105         h$ *= 1000003;
    106         h$ ^= type;
    107         h$ *= 1000003;
    108         h$ ^= (name == null) ? 0 : name.hashCode();
    109         h$ *= 1000003;
    110         h$ ^= channels.hashCode();
    111         return h$;
    112     }
    113 
    114 }
    115