All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.unstoppabledomains.exceptions.NSExceptionParams Maven / Gradle / Ivy

Go to download

Resolution library that talks with etherium .crypto registry to resolve various information attached to .crypto domain

There is a newer version: 2.0.0u
Show newest version
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 ;
      }
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy