com.unstoppabledomains.exceptions.NSExceptionParams Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unstoppable-resolution Show documentation
Show all versions of unstoppable-resolution Show documentation
Resolution library that talks with etherium .crypto registry to resolve various information attached to .crypto domain
package com.unstoppabledomains.exceptions;
public class NSExceptionParams {
public String domain;
public String namingService;
public String coinTicker;
public String contractAddress;
public String methodName;
public NSExceptionParams(String format, String ...args) {
String[] options = format.split("|");
int index = 0;
for (String option: options) {
if (option.equals("|")) continue;
parseOption(option, args[index++]);
}
}
private void parseOption(String option, String value) {
switch(option) {
case "d": {
this.domain = value;
return ;
}
case "n": {
this.namingService = value;
return ;
}
case "c": {
this.coinTicker = value;
return;
}
case "a": {
this.contractAddress = value;
return;
}
case "m": {
this.methodName = value;
return;
}
default: {
return ;
}
}
}
}