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 package com.android.tv.data.epg; 18 19 import com.android.tv.data.api.Channel; 20 21 /** 22 * Hand copy of generated Autovalue class. 23 * 24 * TODO get autovalue working 25 */ 26 final class AutoValue_EpgReader_EpgChannel extends EpgReader.EpgChannel { 27 28 private final Channel channel; 29 private final String epgChannelId; 30 31 AutoValue_EpgReader_EpgChannel( 32 Channel channel, 33 String epgChannelId) { 34 if (channel == null) { 35 throw new NullPointerException("Null channel"); 36 } 37 this.channel = channel; 38 if (epgChannelId == null) { 39 throw new NullPointerException("Null epgChannelId"); 40 } 41 this.epgChannelId = epgChannelId; 42 } 43 44 @Override 45 public Channel getChannel() { 46 return channel; 47 } 48 49 @Override 50 public String getEpgChannelId() { 51 return epgChannelId; 52 } 53 54 @Override 55 public String toString() { 56 return "EpgChannel{" 57 + "channel=" + channel + ", " 58 + "epgChannelId=" + epgChannelId 59 + "}"; 60 } 61 62 @Override 63 public boolean equals(Object o) { 64 if (o == this) { 65 return true; 66 } 67 if (o instanceof EpgReader.EpgChannel) { 68 EpgReader.EpgChannel that = (EpgReader.EpgChannel) o; 69 return (this.channel.equals(that.getChannel())) 70 && (this.epgChannelId.equals(that.getEpgChannelId())); 71 } 72 return false; 73 } 74 75 @Override 76 public int hashCode() { 77 int h = 1; 78 h *= 1000003; 79 h ^= this.channel.hashCode(); 80 h *= 1000003; 81 h ^= this.epgChannelId.hashCode(); 82 return h; 83 } 84 85 } 86 87