86 lines
2.6 KiB
Java
86 lines
2.6 KiB
Java
package com.facetec.sdk;
|
|
|
|
import java.lang.reflect.Field;
|
|
import java.util.Locale;
|
|
|
|
/* loaded from: classes.dex */
|
|
public enum du implements dw {
|
|
IDENTITY { // from class: com.facetec.sdk.du.1
|
|
@Override // com.facetec.sdk.dw
|
|
public final String a(Field field) {
|
|
return field.getName();
|
|
}
|
|
},
|
|
UPPER_CAMEL_CASE { // from class: com.facetec.sdk.du.5
|
|
@Override // com.facetec.sdk.dw
|
|
public final String a(Field field) {
|
|
return a(field.getName());
|
|
}
|
|
},
|
|
UPPER_CAMEL_CASE_WITH_SPACES { // from class: com.facetec.sdk.du.2
|
|
@Override // com.facetec.sdk.dw
|
|
public final String a(Field field) {
|
|
return a(e(field.getName(), " "));
|
|
}
|
|
},
|
|
LOWER_CASE_WITH_UNDERSCORES { // from class: com.facetec.sdk.du.3
|
|
@Override // com.facetec.sdk.dw
|
|
public final String a(Field field) {
|
|
return e(field.getName(), "_").toLowerCase(Locale.ENGLISH);
|
|
}
|
|
},
|
|
LOWER_CASE_WITH_DASHES { // from class: com.facetec.sdk.du.4
|
|
@Override // com.facetec.sdk.dw
|
|
public final String a(Field field) {
|
|
return e(field.getName(), "-").toLowerCase(Locale.ENGLISH);
|
|
}
|
|
},
|
|
LOWER_CASE_WITH_DOTS { // from class: com.facetec.sdk.du.8
|
|
@Override // com.facetec.sdk.dw
|
|
public final String a(Field field) {
|
|
return e(field.getName(), ".").toLowerCase(Locale.ENGLISH);
|
|
}
|
|
};
|
|
|
|
/* synthetic */ du(byte b) {
|
|
this();
|
|
}
|
|
|
|
static String e(String str, String str2) {
|
|
StringBuilder sb = new StringBuilder();
|
|
int length = str.length();
|
|
for (int i = 0; i < length; i++) {
|
|
char charAt = str.charAt(i);
|
|
if (Character.isUpperCase(charAt) && sb.length() != 0) {
|
|
sb.append(str2);
|
|
}
|
|
sb.append(charAt);
|
|
}
|
|
return sb.toString();
|
|
}
|
|
|
|
static String a(String str) {
|
|
int length = str.length();
|
|
int i = 0;
|
|
while (!Character.isLetter(str.charAt(i)) && i < length - 1) {
|
|
i++;
|
|
}
|
|
char charAt = str.charAt(i);
|
|
if (Character.isUpperCase(charAt)) {
|
|
return str;
|
|
}
|
|
char upperCase = Character.toUpperCase(charAt);
|
|
if (i == 0) {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(upperCase);
|
|
sb.append(str.substring(1));
|
|
return sb.toString();
|
|
}
|
|
StringBuilder sb2 = new StringBuilder();
|
|
sb2.append(str.substring(0, i));
|
|
sb2.append(upperCase);
|
|
sb2.append(str.substring(i + 1));
|
|
return sb2.toString();
|
|
}
|
|
}
|