1 /* 2 * Copyright 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.pump.db; 18 19 import androidx.annotation.AnyThread; 20 import androidx.annotation.NonNull; 21 import androidx.annotation.Nullable; 22 23 @AnyThread 24 public abstract class Video { 25 private final long mId; 26 private final String mMimeType; 27 Video(long id, @NonNull String mimeType)28 Video(long id, @NonNull String mimeType) { 29 mId = id; 30 mMimeType = mimeType; 31 } 32 getId()33 public long getId() { 34 return mId; 35 } 36 getMimeType()37 public @NonNull String getMimeType() { 38 return mMimeType; 39 } 40 41 @Override equals(@ullable Object obj)42 public final boolean equals(@Nullable Object obj) { 43 return obj instanceof Video && mId == ((Video) obj).mId; 44 } 45 46 @Override hashCode()47 public final int hashCode() { 48 return (int) (mId ^ (mId >>> 32)); 49 } 50 } 51