class VitamCodeHelper {

    public static VitamCode getFrom(String code) {
        ParametersChecker.checkParameter("Code cannot be null or empty", code);
        if (code.length() != VITAM_CODE_SIZE || !VitamCodeHelper.isAlphanumericCode(code)) {
            throw new IllegalArgumentException("Code must have six characters alphanumerics");
        }
        final ServiceName service =
            ServiceName.getFromCode(code.substring(START_SERVICE_INDEX, END_SERVICE_START_DOMAIN_INDEX));
        final DomainName domain =
            DomainName.getFromCode(code.substring(END_SERVICE_START_DOMAIN_INDEX, END_DOMAIN_START_ITEM_INDEX));
        final String item = code.substring(END_DOMAIN_START_ITEM_INDEX, END_ITEM_INDEX);

        return getFrom(service, domain, item);
    }

    private  VitamCodeHelper();

}