public class FindOptions extends Object implements Serializable
find 和 findAll 方法的选项。可用于:find 方法未找到对象时应抛出 ObjectNotFoundException 异常还是应返回 null 值。对于 findAll 方法而言,如果未找到对象,返回一个空列表。| Constructor and Description |
|---|
FindOptions()
使用默认值创建选项。
|
FindOptions(boolean throwObjectNotFoundException)
使用指定的
throwObjectNotFoundException 标志和默认的超时(如:CommonOptions.OPT_WAIT_RESOLVE_OBJDEF 选项的值)创建查找选项。 |
FindOptions(boolean throwObjectNotFoundException,
int timeout)
使用指定的参数创建查找选项。
|
FindOptions(int timeout)
使用指定的超时和
throwObjectNotFoundException 标志位的默认值(true)创建查找选项。 |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
getTimeout()
返回超时,单位为毫秒。
|
int |
hashCode() |
void |
setTimeout(int timeout)
设置查找对象的超时,单位为毫秒。
|
boolean |
throwObjectNotFoundException() |
void |
throwObjectNotFoundException(boolean state)
|
String |
toString() |
public FindOptions()
CommonOptions.OPT_WAIT_RESOLVE_OBJDEF 选项的值。默认情况下,如果 find 方法未找到对象,则抛出 ObjectNotFoundException 异常。
public FindOptions(boolean throwObjectNotFoundException,
int timeout)
throwObjectNotFoundException - 指定当 find 方法未找到对象时,应抛出 ObjectNotFoundException 异常还是应返回 null。注:对于 findAll 方法而言,如果未找到对象,返回一个空列表。timeout - 查找对象的超时,单位为毫秒。若找不到对象,代理会重试查找操作,直到超时为止。
public FindOptions(boolean throwObjectNotFoundException)
throwObjectNotFoundException 标志和默认的超时(如:CommonOptions.OPT_WAIT_RESOLVE_OBJDEF 选项的值)创建查找选项。throwObjectNotFoundException - 指定当 find 方法未找到对象时,应抛出 ObjectNotFoundException 异常还是应返回 null。注:对于 findAll 方法而言,如果未找到对象,返回一个空列表。
public FindOptions(int timeout)
throwObjectNotFoundException 标志位的默认值(true)创建查找选项。timeout - public void throwObjectNotFoundException(boolean state)
state - 未找到对象时,若抛出 ObjectNotFoundException 异常,则为true(默认值);若返回 null,则为 false。
public boolean throwObjectNotFoundException()
true 表明当 find 方法未找到对象时抛出 ObjectNotFoundException 异常;false 表明返回 null。注:对于 findAll 方法而言,如果未找到对象,返回一个空列表。
public int getTimeout()
CommonOptions.OPT_WAIT_RESOLVE_OBJDEF 选项中指定的默认超时。public void setTimeout(int timeout)
timeout - 以毫秒为单位的超时
Copyright 2009-2012 Micro Focus. All Rights Reserved.