com.amazonaws.kinesisvideo.parser.ebml.EBMLElementMetaData Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of amazon-kinesis-video-streams-parser-library Show documentation
Show all versions of amazon-kinesis-video-streams-parser-library Show documentation
The Amazon Kinesis Video Streams Parser Library for Java enables Java developers to parse the streams
returned by GetMedia calls to Amazon Kinesis Video.
// Generated by delombok at Thu Mar 10 20:43:17 UTC 2022
/*
Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License.
A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file.
This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
*/
package com.amazonaws.kinesisvideo.parser.ebml;
/**
* Class that represents the metadata of a single EBML element in an EBML stream.
* It does not contain the actual data or content of the EBML element.
*/
public class EBMLElementMetaData {
private final EBMLTypeInfo typeInfo;
private final long elementNumber;
public boolean isMaster() {
return typeInfo.getType() == EBMLTypeInfo.TYPE.MASTER;
}
@SuppressWarnings("all")
EBMLElementMetaData(final EBMLTypeInfo typeInfo, final long elementNumber) {
this.typeInfo = typeInfo;
this.elementNumber = elementNumber;
}
@SuppressWarnings("all")
public static class EBMLElementMetaDataBuilder {
@SuppressWarnings("all")
private EBMLTypeInfo typeInfo;
@SuppressWarnings("all")
private long elementNumber;
@SuppressWarnings("all")
EBMLElementMetaDataBuilder() {
}
/**
* @return {@code this}.
*/
@SuppressWarnings("all")
public EBMLElementMetaData.EBMLElementMetaDataBuilder typeInfo(final EBMLTypeInfo typeInfo) {
this.typeInfo = typeInfo;
return this;
}
/**
* @return {@code this}.
*/
@SuppressWarnings("all")
public EBMLElementMetaData.EBMLElementMetaDataBuilder elementNumber(final long elementNumber) {
this.elementNumber = elementNumber;
return this;
}
@SuppressWarnings("all")
public EBMLElementMetaData build() {
return new EBMLElementMetaData(this.typeInfo, this.elementNumber);
}
@Override
@SuppressWarnings("all")
public String toString() {
return "EBMLElementMetaData.EBMLElementMetaDataBuilder(typeInfo=" + this.typeInfo + ", elementNumber=" + this.elementNumber + ")";
}
}
@SuppressWarnings("all")
public static EBMLElementMetaData.EBMLElementMetaDataBuilder builder() {
return new EBMLElementMetaData.EBMLElementMetaDataBuilder();
}
@SuppressWarnings("all")
public EBMLTypeInfo getTypeInfo() {
return this.typeInfo;
}
@SuppressWarnings("all")
public long getElementNumber() {
return this.elementNumber;
}
@Override
@SuppressWarnings("all")
public String toString() {
return "EBMLElementMetaData(typeInfo=" + this.getTypeInfo() + ", elementNumber=" + this.getElementNumber() + ")";
}
@Override
@SuppressWarnings("all")
public boolean equals(final Object o) {
if (o == this) return true;
if (!(o instanceof EBMLElementMetaData)) return false;
final EBMLElementMetaData other = (EBMLElementMetaData) o;
if (!other.canEqual((Object) this)) return false;
if (this.getElementNumber() != other.getElementNumber()) return false;
final Object this$typeInfo = this.getTypeInfo();
final Object other$typeInfo = other.getTypeInfo();
if (this$typeInfo == null ? other$typeInfo != null : !this$typeInfo.equals(other$typeInfo)) return false;
return true;
}
@SuppressWarnings("all")
protected boolean canEqual(final Object other) {
return other instanceof EBMLElementMetaData;
}
@Override
@SuppressWarnings("all")
public int hashCode() {
final int PRIME = 59;
int result = 1;
final long $elementNumber = this.getElementNumber();
result = result * PRIME + (int) ($elementNumber >>> 32 ^ $elementNumber);
final Object $typeInfo = this.getTypeInfo();
result = result * PRIME + ($typeInfo == null ? 43 : $typeInfo.hashCode());
return result;
}
}