public class

EntityUtils

extends Object
java.lang.Object
   ↳ com.atlassian.core.ofbiz.util.EntityUtils

This class is deprecated.
Use EntityUtils instead. Since v5.1.

Class Overview

This was taken from atlassian-ofbiz and placed into its now rightful home of JIRA.

Summary

Public Constructors
EntityUtils()
Public Methods
static boolean contains(Collection<GenericValue> entities, GenericValue entity)
This method is deprecated. Not used in JIRA code - please replicate this if you want to use it. Since v5.1.
static GenericValue createValue(String entity, Map<String, ?> paramMap)
This method is deprecated. Use createValue(String, java.util.Map) instead. Since v5.1.
static List<GenericValue> filterByAnd(List<GenericValue> values, List<? extends EntityExpr> exprs)
This method is deprecated. Use filterByAnd(java.util.List, java.util.List) instead or write your own filter. Since v5.1.
static String getNextStringId(String entityName)
This method is deprecated. Use getNextStringId(String) instead. Since v5.1.
static EntityOperator getOperator(String code)
This method is deprecated. Not used in JIRA code - please replicate this if you want to use it. Since v5.1.
static boolean identical(GenericValue v1, GenericValue v2)
This method is deprecated. Use identical(org.ofbiz.core.entity.GenericValue, org.ofbiz.core.entity.GenericValue) instead. Since v5.1.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public EntityUtils ()

Public Methods

public static boolean contains (Collection<GenericValue> entities, GenericValue entity)

This method is deprecated.
Not used in JIRA code - please replicate this if you want to use it. Since v5.1.

Checks if a collection of entities contains an identical entity to the one provided.

Parameters
entities The list of entities to search
entity The entity to search for and compare to
Returns
  • The matching entity, or null if no matching entity is found

public static GenericValue createValue (String entity, Map<String, ?> paramMap)

This method is deprecated.
Use createValue(String, java.util.Map) instead. Since v5.1.

Create a new entity. If there is no "id" in the parameter list, one is created using the entity sequence

Throws
GenericEntityException

public static List<GenericValue> filterByAnd (List<GenericValue> values, List<? extends EntityExpr> exprs)

This method is deprecated.
Use filterByAnd(java.util.List, java.util.List) instead or write your own filter. Since v5.1.

This method is analogous to the OFBiz EntityUtil.filterByAnd method except that theirs does not filter on GT, GTE, LT, LTE yet.

Parameters
values A collection of GenericValues
exprs The expressions that must validate to true
Returns
  • Collection of GenericValues that match the expression list

public static String getNextStringId (String entityName)

This method is deprecated.
Use getNextStringId(String) instead. Since v5.1.

Calculate a new entity ID (by basically taking one more than the max integer that exists). If there are string IDs here, they will not be affected.

Throws
GenericEntityException

public static EntityOperator getOperator (String code)

This method is deprecated.
Not used in JIRA code - please replicate this if you want to use it. Since v5.1.

Small utility method to get an entity operator from it's code

public static boolean identical (GenericValue v1, GenericValue v2)

This method is deprecated.
Use identical(org.ofbiz.core.entity.GenericValue, org.ofbiz.core.entity.GenericValue) instead. Since v5.1.

Compare two GenericValues based on their content. This method will check the keys and values of both GenericValues. There is only a single difference between this method and GenericValue.equals(gv2), that is that if one GV has no key of a certain type, and the other has a null value for that key, they are still deemed to be identical (as GenericValue.get(key) always returns null if the key exists or not).

Returns
  • true if the issues are the same, false if they are different