Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull out EmojiRange to package level.
- Loading branch information
1 parent
b8672b0
commit cfc99c8
Showing
4 changed files
with
37 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.vanniktech.emoji; | ||
|
||
import android.support.annotation.NonNull; | ||
import com.vanniktech.emoji.emoji.Emoji; | ||
|
||
final class EmojiRange { | ||
final int start; | ||
final int end; | ||
final Emoji emoji; | ||
|
||
EmojiRange(final int start, final int end, @NonNull final Emoji emoji) { | ||
this.start = start; | ||
this.end = end; | ||
this.emoji = emoji; | ||
} | ||
|
||
@Override public boolean equals(final Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
|
||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
|
||
final EmojiRange that = (EmojiRange) o; | ||
|
||
return start == that.start && end == that.end && emoji.equals(that.emoji); | ||
} | ||
|
||
@Override public int hashCode() { | ||
int result = start; | ||
result = 31 * result + end; | ||
result = 31 * result + emoji.hashCode(); | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters