code: public static String getName(ObjectMeta entity) {
      if (entity != null) {
        return Utils.coalesce(entity.getName(),
          getAdditionalPropertyText(entity.getAdditionalProperties(), "id"),
          entity.getUid());
      } else {
        return null;
      }
    }
docs: Returns name of the resource from it's Metadata
  
  @param entity MetaData of kubernetes resource
  @return returns name of resource