Give a name to a DomainObjectMatch for better readability in a Java-DSL like string representation
@param domainObjectMatch
@param as
@return
491829
public QueryPersistor augment(DomainObjectMatch<?> domainObjectMatch, String as) {
		if (this.augmentations == null)
			this.augmentations = new HashMap<DomainObjectMatch<?>, String>();
		this.augmentations.put(domainObjectMatch, as);
		return this;
	}
519079
public List<String> getDomainObjectTypeNames() {
		List<DomainObjectType> types = getDomainObjectTypes();
		List<String> typeNames = new ArrayList<String>(types.size());
		for (DomainObjectType typ : types) {
			typeNames.add(typ.getTypeName());
		}
		return typeNames;
	}
719512
protected String escapeObjectName(ObjectName objectName) {
        StringBuilder result = new StringBuilder();
        appendEscapedNonAlphaNumericChars(objectName.getDomain(), result);
        result.append('.');
        List<String> keys = Collections.list(objectName.getKeyPropertyList().keys());
        Collections.sort(keys);
        for (Iterator<String> it = keys.iterator(); it.hasNext(); ) {
            String key = it.next();
            appendEscapedNonAlphaNumericChars(key, result);
            result.append("__");
            appendEscapedNonAlphaNumericChars(objectName.getKeyProperty(key), result);
            if (it.hasNext()) {
                result.append('.');
            }
        }
        logger.trace("escapeObjectName({}): {}", objectName, result);
        return result.toString();
    }
759904
@Override
  public byte[] encode(final NamingLookupResponse obj) {
    final List<AvroNamingAssignment> assignments = new ArrayList<>(obj.getNameAssignments().size());
    for (final NameAssignment nameAssignment : obj.getNameAssignments()) {
      assignments.add(AvroNamingAssignment.newBuilder()
          .setId(nameAssignment.getIdentifier().toString())
          .setHost(nameAssignment.getAddress().getHostName())
          .setPort(nameAssignment.getAddress().getPort())
          .build());
    }
    return AvroUtils.toBytes(
        AvroNamingLookupResponse.newBuilder().setTuples(assignments).build(), AvroNamingLookupResponse.class
    );
  }
107782
@Override
    public Object lookup(String s) throws NamingException {
        if (s == null)
            throw new InvalidNameException();
        //turn the String into a CompositeName and then use the Name form of the method
        //all necessary parsing etc will be done there
        return lookup(newCompositeName(s));
    }
631610
@Override
    public String getName () {
        boolean d = this.domain != null && this.domain.length() > 0;
        return d ? this.domain + "\\" + this.username : this.username;
    }
492377
@SuppressWarnings("unchecked")
	public <T> DomainObjectMatch<T> createMatchFor(T domainObject) {
		DomainObjectMatch<T> ret;
		if (domainObject.getClass().equals(DomainObject.class)) { // generic model
			List<DomainObject> source = new ArrayList<DomainObject>();
			source.add((DomainObject) domainObject);
			String typeName = ((DomainObject)domainObject).getDomainObjectType().getName();
			ret = (DomainObjectMatch<T>) createGenMatchForInternal(source, typeName);
		} else {
			List<T> source = new ArrayList<T>();
			source.add(domainObject);
			ret = this.createMatchForInternal(source, (Class<T>)domainObject.getClass());
		}
		DomainObjectMatch<?> delegate = APIAccess.getDelegate(ret);
		DomainObjectMatch<?> match = delegate != null ? delegate : ret;
		QueryRecorder.recordAssignment(this, "createMatchFor", match,
				QueryRecorder.reference(domainObject));
		return ret;
	}
494998
public ObjectName preRegister(MBeanServer server, ObjectName name)
			throws Exception {
		oname=name;
        mserver=server;
        domain=name.getDomain();
        return name;
	}
234801
protected String getMappedFieldName(Field field, @Nullable Class<?> domainType) {
		return getMappedFieldName(field.getName(), domainType);
	}
963289
public OvhOfficeDomain serviceName_domain_domainName_GET(String serviceName, String domainName) throws IOException {
		String qPath = "/license/office/{serviceName}/domain/{domainName}";
		StringBuilder sb = path(qPath, serviceName, domainName);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhOfficeDomain.class);
	}
79443
public static ASN1OctetString getInstance(
        Object  obj)
    {
        if (obj == null || obj instanceof ASN1OctetString)
        {
            return (ASN1OctetString)obj;
        }

        if (obj instanceof ASN1TaggedObject)
        {
            return getInstance(((ASN1TaggedObject)obj).getObject());
        }

        if (obj instanceof ASN1Sequence)
        {
            Vector      v = new Vector();
            Enumeration e = ((ASN1Sequence)obj).getObjects();

            while (e.hasMoreElements())
            {
                v.addElement(e.nextElement());
            }

            return new BERConstructedOctetString(v);
        }

        throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
    }
764199
public List<String> findOnlyExistingMatchingObjectNames(String objectExpression) {
        String[] parts = objectExpression.split(",");

        List<String> allSortedObjectNames = getSortedObjectNames();
        List<String> resultingObjectNames = new LinkedList<>();

        for (String part : parts) {
            String singleExpression = part.trim();
            if (!singleExpression.isEmpty()) {
                if (GalenUtils.isObjectGroup(singleExpression)) {
                    resultingObjectNames.addAll(findObjectsInGroup(GalenUtils.extractGroupName(singleExpression)));
                } else if (GalenUtils.isObjectsSearchExpression(singleExpression)) {
                    Pattern objectPattern = GalenUtils.convertObjectNameRegex(singleExpression);
                    for (String objectName : allSortedObjectNames) {
                        if (objectPattern.matcher(objectName).matches()) {
                            resultingObjectNames.add(objectName);
                        }
                    }
                } else if (objects.containsKey(singleExpression)) {
                    resultingObjectNames.add(singleExpression);
                }
            }
        }
        return resultingObjectNames;
    }
21172
public ObjectName createObjectName() {
        try {
            if (StringUtils.hasText(objectName)) {
                return new ObjectName(objectDomain + ":" + objectName);
            }

            if (type != null) {
                if (StringUtils.hasText(objectDomain)) {
                    return new ObjectName(objectDomain, "type", type.getSimpleName());
                }

                return new ObjectName(type.getPackage().getName(), "type", type.getSimpleName());
            }

            return new ObjectName(objectDomain, "name", name);
        } catch (NullPointerException | MalformedObjectNameException e) {
            throw new CitrusRuntimeException("Failed to create proper object name for managed bean", e);
        }
    }
207961
public <T> DomainObjectMatch<T> createMatch(Class<T> domainObjectType) {
		DomainObjectMatch<T> ret = createMatchInternal(domainObjectType);
		QueryRecorder.recordAssignment(this, "createMatch", ret,
				QueryRecorder.literal(domainObjectType.getName()));
		return ret;
	}
731889
public static String getFullClassName(String domainName, String packageName, String className) {
       if (packageName != null)
           if (packageName.length() > 0) {
               if (packageName.charAt(packageName.length() - 1) != '.')
                   packageName = packageName + '.';
           }
       if (className != null)
           if (className.length() > 0) {
               if (className.indexOf('.') == -1)
                   if (packageName != null)
                       className = packageName + className;
               if (className.charAt(0) == '.')
               {
               	if (domainName != null)
               	{
               		if (domainName.endsWith("."))
               			className = domainName + className.substring(1);
               		else
               			className = domainName + className;
               	}
               	else
                       className = Constant.ROOT_PACKAGE + className.substring(1);
               }
           }
       return className;
   }
935237
public DslExpression<T> as(String alias) {
        return as(ExpressionUtils.path(getType(), alias));
    }
191201
static String domainOf(String url) {
    int start = -1;
    if (url.startsWith("//")) {
      start = 2;
    } else {
      start = url.indexOf("://");
      if (start >= 0) { start += 3; }
    }
    if (start < 0) { return null; }
    for (int i = 0; i < start - 3; ++i) {
      switch (url.charAt(i)) {
      case '/': case '?': case '#': return null;
      default: break;
      }
    }
    int end = url.length();
    for (int i = start; i < end; ++i) {
      switch (url.charAt(i)) {
      case '/': case '?': case '#': end = i; break;
      default: break;
      }
    }
    if (start < end) {
      return url.substring(start, end);
    } else {
      return null;
    }
  }