blob: 8c8450e5fdc489292bc2323974b773a043866c11 [file] [log] [blame]
Omer Nebil Yaveroglu01f7ece2020-01-08 12:53:39 +00001/*
2 * Copyright (C) 2020 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
17package com.android.server.integrity.parser;
18
19import android.annotation.Nullable;
20
21/**
22 * A wrapper class to represent an indexing range that is identified by the {@link
23 * RuleIndexingController}.
24 */
25public class RuleIndexRange {
26 private static int sStartIndex;
27 private static int sEndIndex;
28
29 /** Constructor with start and end indexes. */
30 public RuleIndexRange(int startIndex, int endIndex) {
31 this.sStartIndex = startIndex;
32 this.sEndIndex = endIndex;
33 }
34
35 /** Returns the startIndex. */
36 public int getStartIndex() {
37 return sStartIndex;
38 }
39
40 /** Returns the end index. */
41 public int getEndIndex() {
42 return sEndIndex;
43 }
44
45 @Override
46 public boolean equals(@Nullable Object object) {
47 return sStartIndex == ((RuleIndexRange) object).getStartIndex()
48 && sEndIndex == ((RuleIndexRange) object).getEndIndex();
49 }
50}