接口 BanEntry<T>
- 类型参数:
- T- 封禁目标
封禁条目包括以下属性:
| 属性 | 描述 | 
|---|---|
| 目标玩家资料 / IP地址 | 目标玩家资料或IP地址 | 
| 创建日期 | 本次封禁的创建日期(开始日期) | 
| 创建者 | 封禁的创建者,可以是玩家、控制台、插件等 | 
| 到期时间 | 封禁的到期时间 | 
| 理由 | 封禁的理由 | 
 未保存的信息不会自动写入到实现的封禁列表中, 
 反而, save() 方法必须被调用, 以保存到封禁列表中.
 如果本封禁条目已经过期(例如unban命令)或不再存在于封禁列表中,save() 方法
 的调用将重新添加本条目至封禁列表, 
 因而导致再次封禁指定的受害者.
 同样地, 对相关的BanList或其他的条目的更改可能或可能不会反映在此条目上.
 
译注: 最后一句是什么意思呢? 您每次从BanList里获取的BanEntry都是 不同的对象(不同的内存地址), 您对其中一个BanEntry进行了修改, 但这并不会影响另一个 已经获取到的BanEntry, 另一个BanEntry获取到的信息自然跟您修改后的信息不符.
- 
方法概要修饰符和类型方法说明获取本次封禁的目标.获取本次封禁的开始时间.获取本次封禁的过期时间.获取此次封禁的理由.获取本次封禁的操作者.已过时。voidremove()从对应的封禁列表中移除此封禁条目.voidsave()保存这个封禁条目, 将覆盖在封禁列表里的数据.voidsetCreated(@NotNull Date created) 设置本次封禁的开始时间.voidsetExpiration(@Nullable Date expiration) 设置本次封禁的过期时间.void设置此次封禁的理由.void设置本次封禁的操作者.
- 
方法详细资料- 
getTarget已过时。获取本次封禁的目标. 这可能是一个IP地址或玩家名.原文: Gets the target involved. This may be in the form of an IP or a player name. - 返回:
- 被封禁的玩家的名字或IP地址
 
- 
getBanTarget获取本次封禁的目标.原文:Gets the target involved. - 返回:
- 被封禁的玩家资料或IP地址
 
- 
getCreated获取本次封禁的开始时间.原文: Gets the date this ban entry was created. - 返回:
- 封禁开始时间
 
- 
setCreated设置本次封禁的开始时间.原文: Sets the date this ban entry was created. - 参数:
- created- 要设置的日期,不能为null
- 另请参阅:
 
- 
getSource获取本次封禁的操作者.注意: 操作者可以是任何字符串, 虽然大部分情况是玩家名. 原文: Gets the source of this ban. Note: A source is considered any String, although this is generally a player name. - 返回:
- 封禁操作者
 
- 
setSource设置本次封禁的操作者.注意: 操作者可以是任何字符串,虽然大部分情况是玩家名. 原文: Sets the source of this ban. Note: A source is considered any String, although this is generally a player name. - 参数:
- source- 新的操作者, 若设为null将变为空字符串
- 另请参阅:
 
- 
getExpiration获取本次封禁的过期时间. null为永不过期.原文: Gets the date this ban expires on, or null for no defined end date. - 返回:
- 过期时间
 
- 
setExpiration设置本次封禁的过期时间. 设为null则表示永不过期.原文: Sets the date this ban expires on. Null values are considered "infinite" bans. - 参数:
- expiration- 新的封禁过期时间, null则表示永不过期
- 另请参阅:
 
- 
getReason获取此次封禁的理由.原文: Gets the reason for this ban. - 返回:
- 封禁理由, null为尚未设置, 使用默认值
 
- 
setReason设置此次封禁的理由.原文: Sets the reason for this ban. Reasons must not be null. - 参数:
- reason- 新的封禁理由, null表示使用默认值
- 另请参阅:
 
- 
savevoid save()保存这个封禁条目, 将覆盖在封禁列表里的数据.保存关于一个未被封禁的玩家的封禁条目, 将导致这个玩家再一次被封禁. 原文: Saves the ban entry, overwriting any previous data in the ban list. Saving the ban entry of an unbanned player will cause the player to be banned once again. 
- 
removevoid remove()从对应的封禁列表中移除此封禁条目.原文:Removes this ban entry from the appropriate ban list. 
 
- 
getBanTarget()