Sync with L2jServer Ertheia Mar 27th 2015.
This commit is contained in:
@ -26,9 +26,9 @@ import com.l2jserver.gameserver.network.serverpackets.shuttle.ExShuttleMove;
|
||||
*/
|
||||
public class L2ShuttleAI extends L2VehicleAI
|
||||
{
|
||||
public L2ShuttleAI(L2ShuttleInstance l2ShuttleInstance)
|
||||
public L2ShuttleAI(L2ShuttleInstance actor)
|
||||
{
|
||||
super(l2ShuttleInstance);
|
||||
super(actor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -389,11 +389,11 @@ public final class SpawnTable implements IXmlReader
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a spawn for the given NPC ID.
|
||||
* Finds a spawn for the given NPC ID.
|
||||
* @param npcId the NPC Id
|
||||
* @return a spawn for the given NPC ID or {@code null}
|
||||
*/
|
||||
public L2Spawn getAnySpawn(int npcId)
|
||||
public L2Spawn findAny(int npcId)
|
||||
{
|
||||
return getSpawns(npcId).stream().findFirst().orElse(null);
|
||||
}
|
||||
|
@ -154,6 +154,7 @@ public final class AntiFeedManager
|
||||
}
|
||||
|
||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||
|
||||
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
|
||||
|
||||
return connectionCount.getAndIncrement() < (max + Config.L2JMOD_DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0));
|
||||
|
@ -5587,7 +5587,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
abortCast();
|
||||
return;
|
||||
}
|
||||
mut.setTargets(targetList.toArray(new L2Character[targetList.size()]));
|
||||
mut.setTargets(targetList.toArray(new L2Object[targetList.size()]));
|
||||
}
|
||||
|
||||
// Ensure that a cast is in progress
|
||||
|
@ -43,7 +43,12 @@ public class L2ShuttleInstance extends L2Vehicle
|
||||
{
|
||||
super(template);
|
||||
setInstanceType(InstanceType.L2ShuttleInstance);
|
||||
setAI(new L2ShuttleAI(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public L2ShuttleAI initAI()
|
||||
{
|
||||
return new L2ShuttleAI(this);
|
||||
}
|
||||
|
||||
public List<L2ShuttleStop> getStops()
|
||||
|
@ -21,7 +21,7 @@ package com.l2jserver.gameserver.model.holders;
|
||||
import java.time.DayOfWeek;
|
||||
|
||||
/**
|
||||
* Simple class for storing Reenter Data for Intances.
|
||||
* Simple class for storing Reenter Data for Instances.
|
||||
* @author FallenAngel
|
||||
*/
|
||||
public final class InstanceReenterTimeHolder
|
||||
|
@ -452,9 +452,11 @@ public final class Formulas
|
||||
*/
|
||||
public static final double calcCpRegen(L2PcInstance player)
|
||||
{
|
||||
double cpRegenMultiplier = Config.CP_REGEN_MULTIPLIER;
|
||||
// With CON bonus
|
||||
final double init = player.getActingPlayer().getTemplate().getBaseCpRegen(player.getLevel()) * player.getLevelMod() * BaseStats.CON.calcBonus(player);
|
||||
double cpRegenMultiplier = Config.CP_REGEN_MULTIPLIER;
|
||||
|
||||
// Calculate Movement bonus
|
||||
if (player.isSitting())
|
||||
{
|
||||
cpRegenMultiplier *= 1.5; // Sitting
|
||||
|
@ -99,6 +99,7 @@ public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>,
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int opcode = buf.get() & 0xFF;
|
||||
|
||||
ReceivablePacket<L2GameClient> msg = null;
|
||||
|
@ -21,6 +21,7 @@ package com.l2jserver.gameserver.network.clientpackets;
|
||||
import static com.l2jserver.gameserver.model.actor.L2Npc.INTERACTION_DISTANCE;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.data.xml.impl.MultisellData;
|
||||
@ -225,9 +226,10 @@ public class MultiSellChoose extends L2GameClientPacket
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<L2Augmentation> augmentation = new ArrayList<>();
|
||||
List<L2Augmentation> augmentation = new ArrayList<>();
|
||||
Elementals[] elemental = null;
|
||||
/** All ok, remove items and add final product */
|
||||
|
||||
for (Ingredient e : entry.getIngredients())
|
||||
{
|
||||
if (e.getItemId() < 0)
|
||||
|
@ -63,6 +63,7 @@ public final class RequestGiveItemToPet extends L2GameClientPacket
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Alt game - Karma punishment
|
||||
if (!Config.ALT_GAME_KARMA_PLAYER_CAN_TRADE && (player.getKarma() > 0))
|
||||
{
|
||||
|
@ -155,6 +155,7 @@ public final class RequestJoinParty extends L2GameClientPacket
|
||||
private void addTargetToParty(L2PcInstance target, L2PcInstance requestor)
|
||||
{
|
||||
final L2Party party = requestor.getParty();
|
||||
|
||||
// summary of ppl already in party and ppl that get invitation
|
||||
if (!party.isLeader(requestor))
|
||||
{
|
||||
|
@ -53,7 +53,6 @@ public final class RequestRestart extends L2GameClientPacket
|
||||
protected void runImpl()
|
||||
{
|
||||
final L2PcInstance player = getClient().getActiveChar();
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
return;
|
||||
|
@ -153,6 +153,7 @@ public class CharSelectionInfo extends L2GameServerPacket
|
||||
{
|
||||
writeD(charInfoPackage.getPaperdollItemId(slot));
|
||||
}
|
||||
|
||||
for (int slot : getPaperdollOrderVisualId())
|
||||
{
|
||||
writeD(charInfoPackage.getPaperdollItemVisualId(slot));
|
||||
|
@ -76,7 +76,6 @@ public final class RelationChanged extends L2GameServerPacket
|
||||
public RelationChanged()
|
||||
{
|
||||
_mask |= SEND_MULTI;
|
||||
|
||||
_multi = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
@ -418,14 +418,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createWeaponList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if (item.isWeapon() || (item.getItem().getType2() == L2Item.TYPE2_WEAPON) || (item.isEtcItem() && (item.getItemType() == EtcItemType.ARROW)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -433,7 +433,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -443,14 +443,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createArmorList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if (item.isArmor() || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -458,7 +458,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -468,14 +468,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createEtcItemList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if (item.isEtcItem() || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -483,7 +483,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -493,14 +493,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createMatList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.MATERIAL)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -508,7 +508,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -518,14 +518,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createRecipeList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.RECIPE)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -533,7 +533,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -543,14 +543,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createAmulettList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if ((item.isEtcItem() && (item.getItemName().toUpperCase().startsWith("AMULET"))) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -558,7 +558,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -568,14 +568,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createSpellbookList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if ((item.isEtcItem() && (!item.getItemName().toUpperCase().startsWith("AMULET"))) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -583,7 +583,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -593,14 +593,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createConsumableList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if ((item.isEtcItem() && ((item.getEtcItem().getItemType() == EtcItemType.SCROLL) || (item.getEtcItem().getItemType() == EtcItemType.SHOT))) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -608,7 +608,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -618,14 +618,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createShotList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.SHOT)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -633,7 +633,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -643,14 +643,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createScrollList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.SCROLL)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -658,7 +658,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -668,14 +668,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createSeedList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if ((item.isEtcItem() && (item.getEtcItem().getItemType() == EtcItemType.SEED)) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -683,7 +683,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -693,14 +693,14 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createOtherList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if ((item.isEtcItem() && ((item.getEtcItem().getItemType() != EtcItemType.MATERIAL) && (item.getEtcItem().getItemType() != EtcItemType.RECIPE) && (item.getEtcItem().getItemType() != EtcItemType.SCROLL) && (item.getEtcItem().getItemType() != EtcItemType.SHOT))) || (item.getItem().getType2() == L2Item.TYPE2_MONEY))
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -708,7 +708,7 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
}
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -718,19 +718,19 @@ public class SortedWareHouseWithdrawalList extends AbstractItemPacket
|
||||
*/
|
||||
private List<L2WarehouseItem> createAllList(L2ItemInstance[] _items)
|
||||
{
|
||||
List<L2WarehouseItem> _list = new ArrayList<>();
|
||||
List<L2WarehouseItem> list = new ArrayList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if (_list.size() < MAX_SORT_LIST_ITEMS)
|
||||
if (list.size() < MAX_SORT_LIST_ITEMS)
|
||||
{
|
||||
_list.add(new L2WarehouseItem(item));
|
||||
list.add(new L2WarehouseItem(item));
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return _list;
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,12 +27,12 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.text.DateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
@ -60,8 +60,8 @@ public final class TaskManager
|
||||
{
|
||||
protected static final Logger _log = Logger.getLogger(TaskManager.class.getName());
|
||||
|
||||
private final Map<Integer, Task> _tasks = new HashMap<>();
|
||||
protected final List<ExecutedTask> _currentTasks = new ArrayList<>();
|
||||
private final Map<Integer, Task> _tasks = new ConcurrentHashMap<>();
|
||||
protected final List<ExecutedTask> _currentTasks = new CopyOnWriteArrayList<>();
|
||||
|
||||
protected static final String[] SQL_STATEMENTS =
|
||||
{
|
||||
|
@ -301,17 +301,14 @@ public final class Util
|
||||
|
||||
/**
|
||||
* (Based on implode() in PHP)
|
||||
* @param strArray - an array of strings to concatenate
|
||||
* @param strDelim - the delimiter to put between the strings
|
||||
* @param strings an array of strings to concatenate
|
||||
* @param delimiter the delimiter to put between the strings
|
||||
* @return a delimited string for a given array of string elements.
|
||||
*/
|
||||
public static String implodeString(Iterable<String> strArray, String strDelim)
|
||||
public static String implodeString(Iterable<String> strings, String delimiter)
|
||||
{
|
||||
final StringJoiner sj = new StringJoiner(strDelim);
|
||||
for (String str : strArray)
|
||||
{
|
||||
sj.add(str);
|
||||
}
|
||||
final StringJoiner sj = new StringJoiner(delimiter);
|
||||
strings.forEach(sj::add);
|
||||
return sj.toString();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user