Create a match for a domain object which was retrieved by another query
@param domainObject a domain object which was retrieved by another query
@return a DomainObjectMatch
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;
	}
1095907
public GDomainQuery replayGenericQuery(RecordedQuery recordedQuery, IGenericDomainAccess domainAccess) {
		Boolean br_old = null;
		GDomainQuery query;
		try {
			if (!Settings.TEST_MODE) {
				br_old = QueryRecorder.blockRecording.get();
				if (this.createNew)
					QueryRecorder.blockRecording.set(Boolean.FALSE);
				else
					QueryRecorder.blockRecording.set(Boolean.TRUE);
			}
			this.generic = true;
			this.replayedQueryContext = new ReplayedQueryContext(recordedQuery);
			query = ((IIntDomainAccess)domainAccess).getInternalDomainAccess().createRecordedGenQuery(this.replayedQueryContext,
					this.createNew); // do record
			this.id2ObjectMap.put(QueryRecorder.QUERY_ID, query);
			
			for (Statement stmt : recordedQuery.getStatements()) {
				replayStatement(stmt);
			}
		} finally {
			if (!Settings.TEST_MODE)
				QueryRecorder.blockRecording.set(br_old);
		}
		
		return query;
	}
975319
private boolean netscapeDomainMatches(final String domain, final String host) {
        if (domain == null || host == null) {
            return false;
        }

        // if there's no embedded dot in domain and domain is not .local
        boolean isLocalDomain = ".local".equalsIgnoreCase(domain);
        int embeddedDotInDomain = domain.indexOf('.');
        if (embeddedDotInDomain == 0) {
            embeddedDotInDomain = domain.indexOf('.', 1);
        }
        if (!isLocalDomain && (embeddedDotInDomain == -1 || embeddedDotInDomain == domain.length() - 1)) {
            return false;
        }

        // if the host name contains no dot and the domain name is .local
        int firstDotInHost = host.indexOf('.');
        if (firstDotInHost == -1 && isLocalDomain) {
            return true;
        }

        int domainLength = domain.length();
        int lengthDiff = host.length() - domainLength;
        if (lengthDiff == 0) {
            // if the host name and the domain name are just string-compare euqal
            return host.equalsIgnoreCase(domain);
        }
        else if (lengthDiff > 0) {
            // need to check H & D component
            String H = host.substring(0, lengthDiff);
            String D = host.substring(lengthDiff);

            return (D.equalsIgnoreCase(domain));
        }
        else if (lengthDiff == -1) {
            // if domain is actually .host
            return (domain.charAt(0) == '.' &&
                    host.equalsIgnoreCase(domain.substring(1)));
        }

        return false;
    }
45905
public boolean matches(Object obj) {
        if (!(obj instanceof Throwable))
            return false;

        Throwable throwable = (Throwable) obj;

        String foundMessage = throwable.getMessage();

        return expectedMessageMatcher.matches(foundMessage);
    }
292860
public boolean matches(String domain) {
        if (pattern != null) {
            return pattern.matcher(domain).matches();
        }

        return this.domain.equals(domain);
    }
1337747
public static <T> List<Option<T>> createOptions(Collection<T> domainObjects) { 
        List<Option<T>> options = new ArrayList<Option<T>>();
    
        for (T value : domainObjects) {
            String id = String.valueOf(getId(value));
            options.add(new Option<T>(id, value));
        }
    
        return options;
    }
568460
def match(self, dom, act):
        
        return self.match_domain(dom) and self.match_action(act)
439612
protected String applicationTenancyPathForCached(final Object domainObject) {
        return queryResultsCache.execute(new Callable<String>() {
            @Override
            public String call() throws Exception {
                return applicationTenancyPathFor(domainObject);
            }
        }, TenantedAuthorizationFacetDefault.class, "applicationTenancyPathFor", domainObject);
    }
957272
public static ObjectName createObjectName(String domain, String type) {
        try {
            return new ObjectName(domain + ":type=" + type);
        } catch(MalformedObjectNameException e) {
            throw new VoldemortException(e);
        }
    }
443763
@Action(
            domainEvent = DownloadLayoutEvent.class,
            semantics = SemanticsOf.SAFE,
            restrictTo = RestrictTo.PROTOTYPING
    )
    @ActionLayout(
            contributed = Contributed.AS_ACTION,
            cssClassFa = "fa-download"
    )
    @MemberOrder(sequence="500.900")
    public Clob downloadLayout(final Object domainObject) {
        return developerUtilitiesService.downloadLayout(domainObject);
    }
77296
public static dnsnsrec get(nitro_service service, String domain) throws Exception{
		dnsnsrec obj = new dnsnsrec();
		obj.set_domain(domain);
		dnsnsrec response = (dnsnsrec) obj.get_resource(service);
		return response;
	}
602933
def filter_by_domain(self, domain):
        
        query = self._copy()
        query.domain = domain
        return query
1092692
@SuppressWarnings("unchecked")
	public <T> DomainObjectMatch<T> INTERSECTION(DomainObjectMatch<T>... set) {
		DomainObjectMatch<T> ret = this.union_Intersection(false, set);
		Object[] placeHolders = new Object[set.length];
		DomainObjectMatch<?> delegate;
		DomainObjectMatch<?> match;
		for (int i = 0; i < set.length; i++) {
			delegate = APIAccess.getDelegate(set[i]);
			match = delegate != null ? delegate : set[i];
			placeHolders[i] = QueryRecorder.placeHolder(match);
		}
		delegate = APIAccess.getDelegate(ret);
		match = delegate != null ? delegate : ret;
		QueryRecorder.recordAssignment(this, "INTERSECTION", match, placeHolders);
		return ret;
	}
817285
public static function fromDomainObject($domainObject)
    {
        if (!is_object($domainObject)) {
            throw new InvalidDomainObjectException('$domainObject must be an object.');
        }

        try {
            if ($domainObject instanceof DomainObjectInterface) {
                return new self($domainObject->getObjectIdentifier(), ClassUtils::getRealClass($domainObject));
            } elseif (method_exists($domainObject, 'getId')) {
                return new self((string) $domainObject->getId(), ClassUtils::getRealClass($domainObject));
            }
        } catch (\InvalidArgumentException $e) {
            throw new InvalidDomainObjectException($e->getMessage(), 0, $e);
        }

        throw new InvalidDomainObjectException('$domainObject must either implement the DomainObjectInterface, or have a method named "getId".');
    }
327184
protected String createQueryFragmentForCriteria(Criteria part, @Nullable Class<?> domainType) {

		Criteria criteria = part;
		StringBuilder queryFragment = new StringBuilder();
		boolean singeEntryCriteria = (criteria.getPredicates().size() == 1);

		if (criteria instanceof QueryStringHolder) {
			return ((QueryStringHolder) criteria).getQueryString();
		}

		String fieldName = getNullsafeFieldName(criteria.getField(), domainType);
		if (criteria.isNegating()) {
			fieldName = NOT + fieldName;
		}
		if (!StringUtils.isEmpty(fieldName) && !containsFunctionCriteria(criteria.getPredicates())) {
			queryFragment.append(fieldName);
			queryFragment.append(DELIMINATOR);
		}

		// no criteria given is defaulted to not null
		if (criteria.getPredicates().isEmpty()) {
			queryFragment.append("[* TO *]");
			return queryFragment.toString();
		}

		if (!singeEntryCriteria) {
			queryFragment.append("(");
		}

		CriteriaQueryStringValueProvider valueProvider = new CriteriaQueryStringValueProvider(criteria, domainType);
		while (valueProvider.hasNext()) {
			queryFragment.append(valueProvider.next());
			if (valueProvider.hasNext()) {
				queryFragment.append(CRITERIA_VALUE_SEPERATOR);
			}
		}

		if (!singeEntryCriteria) {
			queryFragment.append(")");
		}
		if (!Float.isNaN(criteria.getBoost())) {
			queryFragment.append(BOOST).append(criteria.getBoost());
		}

		return queryFragment.toString();
	}
216920
@SuppressWarnings("unchecked")
    public DataMapper<Object, DBObject> getDataMapper(Class<?> domainObjectClass) {
        if (additionalDataMappers != null) {
            for (DataMapper<Object, DBObject> each : additionalDataMappers) {
                if (each.canMapToData(domainObjectClass)) {
                    return each;
                }
            }
        }
        if (dataMapper.canMapToData(domainObjectClass)) {
            return (DataMapper<Object, DBObject>) dataMapper;
        }
        // no matching
        return null;
    }
520409
public <T> DomainObjectMatch<T> AS(Class<T> domainObjectType) {
		CollectExpression ce = (CollectExpression)this.astObject;
		DomainObjectMatch<T> ret =APIAccess.createDomainObjectMatch(domainObjectType,
				ce.getQueryExecutor().getDomainObjectMatches().size(),
				ce.getQueryExecutor().getMappingInfo());
		ce.setEnd(ret);
		ce.getQueryExecutor().getDomainObjectMatches().add(ret);
		QueryRecorder.recordAssignment(this, "AS", ret, QueryRecorder.literal(domainObjectType.getName()));
		return ret;
	}