2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
14 * This file is based on:
19 * Copyright (c) 2014 LG Electronics.
20 * Created by Hyun Kook Khang on 19 Jan 2014
22 * Licensed under the Apache License, Version 2.0 (the "License");
23 * you may not use this file except in compliance with the License.
24 * You may obtain a copy of the License at
26 * http://www.apache.org/licenses/LICENSE-2.0
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
34 package org.openhab.binding.lgwebos.internal.handler.core;
37 * {@link ChannelInfo} is a value object to describe a channel on WebOSTV.
38 * The id value is mandatory when starting a channel. The channelName is a human readable friendly name, which is not
39 * further interpreted by the TV.
41 * @author Hyun Kook Khang - Connect SDK initial contribution
42 * @author Sebastian Prehn - Adoption for openHAB, removed minor major number, made immutable
44 public class ChannelInfo {
46 private String channelName;
47 private String channelId;
48 private String channelNumber;
49 private String channelType;
51 public ChannelInfo() {
52 // no-argument constructor for gson
55 public ChannelInfo(String channelName, String channelId, String channelNumber, String channelType) {
56 this.channelId = channelId;
57 this.channelNumber = channelNumber;
58 this.channelName = channelName;
59 this.channelType = channelType;
62 public String getName() {
66 public String getId() {
70 public String getChannelNumber() {
75 public String toString() {
76 return "ChannelInfo [channelId=" + channelId + ", channelNumber=" + channelNumber + ", channelName="
77 + channelName + ", channelType=" + channelType + "]";
81 public int hashCode() {
84 result = prime * result + ((channelId == null) ? 0 : channelId.hashCode());
89 public boolean equals(Object obj) {
96 if (getClass() != obj.getClass()) {
99 ChannelInfo other = (ChannelInfo) obj;
100 if (channelId == null) {
101 if (other.channelId != null) {
104 } else if (!channelId.equals(other.channelId)) {