region > findByOwner (programmatic)
509252
@Programmatic
    public List<CommunicationChannelOwnerLink> findByOwner(final Object owner) {
        if(owner == null) {
            return null;
        }
        final Bookmark bookmark = bookmarkService.bookmarkFor(owner);
        if(bookmark == null) {
            return null;
        }
        final String ownerStr = bookmark.toString();
        return repositoryService.allMatches(
                new QueryDefault<>(CommunicationChannelOwnerLink.class,
                        "findByOwner",
                        "ownerStr", ownerStr));
    }
1033515
@SuppressWarnings("unchecked")
	private <T> T getPropertyAs(String propertyName, Class<T> propertyType) {
		final String sValue = properties == null ? null : properties.getProperty(propertyName);
		final T value;
		if (sValue == null) {
			value = null;
		} else if (propertyType.equals(String.class)) {
			value = propertyType.cast(sValue);
		} else if (propertyType.equals(Integer.class)) {
			value = propertyType.cast(Integer.valueOf(sValue));
		} else if (propertyType.equals(int.class)) {
			value = (T) Integer.valueOf(sValue);
		} else if (propertyType.equals(Long.class)) {
			value = propertyType.cast(Long.valueOf(sValue));
		} else if (propertyType.equals(long.class)) {
			value = (T) Long.valueOf(sValue);
		} else if (propertyType.equals(Boolean.class)) {
			value = propertyType.cast(Boolean.valueOf(sValue));
		} else if (propertyType.equals(boolean.class)) {
			value = (T) Boolean.valueOf(sValue);
		} else {
			value = null;
		}
		return value;
	}
1363275
private void followOwner() {
        if (owner.isVisible() && owner.isShowing()) {
            try {
                Point screenLocation = owner.getLocationOnScreen();
                Point relativeSlaveLocation = anchorLink.getRelativeSlaveLocation(owner.getSize(),
                        TransparentToolTipDialog.this.getSize());
                setLocation(screenLocation.x + relativeSlaveLocation.x, screenLocation.y + relativeSlaveLocation.y);
            } catch (IllegalComponentStateException e) {
                LOGGER.error("Failed getting location of component: " + owner, e);
            }
        }
    }
840267
public function getOwner()
    {
        if ($this->owner === null) {
            return null;
        }
        return $this->persistenceManager->getObjectByIdentifier($this->owner, $this->reflectionService->getDefaultImplementationClassNameForInterface(UserInterface::class));
    }
325745
public static String getPropery(String key, PropertyOwner propertyOwner, Map<String,Object> properties, String defaultValue)
    {
        String returnValue = null;
        if (propertyOwner != null)
            returnValue = propertyOwner.getProperty(key);
        if (properties != null) if (returnValue == null)
            returnValue = (String)properties.get(key);
        if (returnValue == null)
            returnValue = defaultValue;
        return returnValue;
    }
754083
@Override
    public OptionalEntity<USER_ENTITY> findLoginUser(Object userId) {
        assertUserIdRequired(userId);
        try {
            @SuppressWarnings("unchecked")
            final ID castId = (ID) userId;
            return doFindLoginUser(castId);
        } catch (ClassCastException e) { // also find method, because of generic cast
            throw new IllegalStateException("Cannot cast the user ID: " + userId.getClass() + ", " + userId, e);
        }
    }
455767
private void getLobLocator(CodeAssembler a, StorablePropertyInfo info) {
        if (!info.isLob()) {
            throw new IllegalArgumentException();
        }
        a.invokeInterface(TypeDesc.forClass(RawSupport.class), "getLocator",
                          TypeDesc.LONG, new TypeDesc[] {info.getStorageType()});
    }
199242
private <T> ResultIterable<T> findByExample(Class<?> type, Map<PrimitivePropertyMethodMetadata<PropertyMetadata>, Object> entity) {
        sessionContext.getCacheSynchronizationService().flush();
        EntityTypeMetadata<EntityMetadata> entityTypeMetadata = sessionContext.getMetadataProvider().getEntityMetadata(type);
        EntityDiscriminator entityDiscriminator = entityTypeMetadata.getDatastoreMetadata().getDiscriminator();
        if (entityDiscriminator == null) {
            throw new XOException("Type " + type.getName() + " has no discriminator (i.e. cannot be identified in datastore).");
        }
        ResultIterator<Entity> iterator = sessionContext.getDatastoreSession().getDatastoreEntityManager().findEntity(entityTypeMetadata, entityDiscriminator,
                entity);
        AbstractInstanceManager<EntityId, Entity> entityInstanceManager = sessionContext.getEntityInstanceManager();
        ResultIterator<T> resultIterator = new ResultIterator<T>() {

            @Override
            public boolean hasNext() {
                return iterator.hasNext();
            }

            @Override
            public T next() {
                Entity entity = iterator.next();
                return entityInstanceManager.readInstance(entity);
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException("Cannot remove instance.");
            }

            @Override
            public void close() {
                iterator.close();
            }
        };
        XOTransaction xoTransaction = sessionContext.getXOTransaction();
        final ResultIterator<T> transactionalIterator = xoTransaction != null ? new TransactionalResultIterator<>(resultIterator, xoTransaction)
                : resultIterator;
        return sessionContext.getInterceptorFactory().addInterceptor(new AbstractResultIterable<T>() {
            @Override
            public ResultIterator<T> iterator() {
                return transactionalIterator;
            }
        }, ResultIterable.class);
    }
1179352
function getOwnPropertyDescriptor(state, prop) {
    const owner = source(state)
    const desc = Reflect.getOwnPropertyDescriptor(owner, prop)
    if (desc) {
        desc.writable = true
        desc.configurable = !Array.isArray(owner) || prop !== "length"
    }
    return desc
}
635842
@Nullable
    @MainThread
    private static LifecycleOwner getLifecycleOwner(ViewDataBinding binding) {
        if (!fieldFaild && lifecycleOwnerField == null) {
            try {
                lifecycleOwnerField = ViewDataBinding.class.getDeclaredField("mLifecycleOwner");
                lifecycleOwnerField.setAccessible(true);
            } catch (NoSuchFieldException e) {
                fieldFaild = true;
                return null;
            }
        }
        if (lifecycleOwnerField == null) {
            return null;
        }
        try {
            return (LifecycleOwner) lifecycleOwnerField.get(binding);
        } catch (IllegalAccessException e) {
            return null;
        }
    }
119916
@Override
    public Object get(PageContext pc, Collection.Key key) throws PageException {
	Member member = getMember(pc, key, true, false);
	if (member != null) return member.getValue();

	// trigger
	if (triggerDataMember(pc) && !isPrivate(pc)) {
	    return callGetter(pc, key);
	}
	throw new ExpressionException("Component [" + getCallName() + "] has no accessible Member with name [" + key + "]",
		"enable [trigger data member] in administrator to also invoke getters and setters");
	// throw new ExpressionException("Component ["+getCallName()+"] has no accessible Member with name
	// ["+name+"]");
    }
266233
@SuppressWarnings("unchecked")
  @Override
  public <T> T findById(Object id, String collectionName) {
    CollectionMetaData cmd = cmdMap.get(collectionName);
    Map<Object, T> collection = (Map<Object, T>) collectionsRef.get().get(collectionName);
    if((null == cmd) || null == collection) {
      throw new InvalidJsonDbApiUsageException("Collection by name '" + collectionName + "' not found. Create collection first.");
    }
    cmd.getCollectionLock().readLock().lock();
    try {
      Object obj = Util.deepCopy(collection.get(id));
      if(encrypted && cmd.hasSecret() && null != obj){
        CryptoUtil.decryptFields(obj, cmd, dbConfig.getCipher());
      }
      return (T) obj;
    } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
      logger.error("Error when decrypting value for a @Secret annotated field for entity: " + collectionName, e);
      throw new JsonDBException("Error when decrypting value for a @Secret annotated field for entity: " + collectionName, e);
    } finally {
      cmd.getCollectionLock().readLock().unlock();
    }
  }
1000114
function find(predicate) {
        var key, elem;
        for (key in _idMap) {
            if (_idMap.hasOwnProperty(key)) {
                elem = _idMap[key];
                if (predicate(elem)) {
                    return elem;
                }
            }
        }
        return null;
    }
1275764
static User findByKey(final EntityManager em, final String userId)
    {
        User user = em.find(User.class, userId);
        logger.info("[On Find by key]");
        System.out.println("#######################START##########################################");
        logger.info("\n");
        logger.info("\t\t User's first name:" + user.getFirstName());
        logger.info("\t\t User's emailId:" + user.getEmailId());
        logger.info("\t\t User's Personal Details:" + user.getPersonalDetail().getName());
        logger.info("\t\t User's Personal Details:" + user.getPersonalDetail().getPassword());
        logger.info("\t\t User's total tweets:" + user.getTweets().size());
        logger.info("\n");
        System.out.println("#######################END############################################");
        logger.info("\n");
        return user;
    }
103203
protected Member getPropertyAccessor(String propertyName) {
		if (readAccessors.containsKey(propertyName)) {
			return (Member) readAccessors.get(propertyName);
		}
		else {
			return (Member) writeAccessors.get(propertyName);
		}
	}
534322
@Override
  public <T> T findById(Object id, Class<T> entityClass) {
    return findById(id, Util.determineCollectionName(entityClass));
  }
378028
def FindByName(cls, name):
        """"""

        reg = ComponentRegistry()
        for _, entry in reg.load_extensions('iotile.auth_provider', name_filter=name):
            return entry