forked from spullara/mustache.java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFragmentKey.java
More file actions
29 lines (25 loc) · 740 Bytes
/
FragmentKey.java
File metadata and controls
29 lines (25 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.github.mustachejava;
/**
* Used for indexing runtime compiled template text from lambdas.
*/
public class FragmentKey {
public final TemplateContext tc;
public final String templateText;
public FragmentKey(TemplateContext tc, String templateText) {
this.tc = tc;
this.templateText = templateText;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
FragmentKey that = (FragmentKey) o;
return tc.equals(that.tc) && templateText.equals(that.templateText);
}
@Override
public int hashCode() {
int result = tc.hashCode();
result = 31 * result + templateText.hashCode();
return result;
}
}