当前位置: 首页>>代码示例>>Java>>正文


Java UUID.equals方法代码示例

本文整理汇总了Java中java.util.UUID.equals方法的典型用法代码示例。如果您正苦于以下问题:Java UUID.equals方法的具体用法?Java UUID.equals怎么用?Java UUID.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.UUID的用法示例。


在下文中一共展示了UUID.equals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRouteGuid

import java.util.UUID; //导入方法依赖的package包/类
private UUID getRouteGuid(String host, UUID domainGuid) {
    Map<String, Object> urlVars = new HashMap<String, Object>();
    String urlPath = "/v2";
    urlPath = urlPath + "/routes?inline-relations-depth=0&q=host:{host}";
    urlVars.put("host", host);
    List<Map<String, Object>> allRoutes = getAllResources(urlPath, urlVars);
    UUID routeGuid = null;
    for (Map<String, Object> route : allRoutes) {
        UUID routeSpace = CloudEntityResourceMapper.getEntityAttribute(route, "space_guid", UUID.class);
        UUID routeDomain = CloudEntityResourceMapper.getEntityAttribute(route, "domain_guid", UUID.class);
        if (sessionSpace.getMeta().getGuid().equals(routeSpace) && domainGuid.equals(routeDomain)) {
            routeGuid = CloudEntityResourceMapper.getMeta(route).getGuid();
        }
    }
    return routeGuid;
}
 
开发者ID:SAP,项目名称:cf-java-client-sap,代码行数:17,代码来源:CloudControllerClientImpl.java

示例2: isTxAvailableToCommitOnOwnNode

import java.util.UUID; //导入方法依赖的package包/类
private boolean isTxAvailableToCommitOnOwnNode(TxInfo txInfo, Lazy<UUID, Set<Object>> availableTxsPerNode) {
    Set<Object> sameNodeScope = availableTxsPerNode.get(txInfo.consumerId());

    if (sameNodeScope.containsAll(txInfo.scope())) {
        return true;
    }
    for (Map.Entry<UUID, Set<Object>> entry : availableTxsPerNode) {
        UUID nodeId = entry.getKey();
        Set<Object> nodeScope = entry.getValue();

        if (!nodeId.equals(txInfo.consumerId()) && !Collections.disjoint(nodeScope, txInfo.scope())) {
            return false;
        }
    }
    return true;
}
 
开发者ID:epam,项目名称:Lagerta,代码行数:17,代码来源:LeadPlanner.java

示例3: syncPlayer

import java.util.UUID; //导入方法依赖的package包/类
private static void syncPlayer(MyPetPlayer mpPlayer) {
    Slot petSlot = getMyPetSlot();
    if (mpPlayer.isOnline() && mpPlayer.hasMyPet()) {
        Player player = mpPlayer.getPlayer();

        if (!InventoryManager.playerIsLoaded(player)) {
            return;
        }

        Inventory inventory = InventoryManager.get(player).getInventory();
        ItemStack currentPet = inventory.getItem(petSlot.getSlotId());
        if (isMyPetItem(currentPet)) {
            MyPet pet = mpPlayer.getMyPet();
            UUID petUUID = UUID.fromString(ItemUtils.getTag(currentPet, MYPET_TAG));
            if (petUUID.equals(pet.getUUID())) {
                return;
            }
        } else {
            inventory.setItem(petSlot.getSlotId(), petSlot.getCup());
        }

        MyPetApi.getMyPetManager().deactivateMyPet(mpPlayer, false);
    }
}
 
开发者ID:EndlessCodeGroup,项目名称:RPGInventory,代码行数:25,代码来源:MyPetManager.java

示例4: onMyPetRemove

import java.util.UUID; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void onMyPetRemove(MyPetRemoveEvent event) {
    Player player = event.getOwner().getPlayer();
    if (!InventoryManager.playerIsLoaded(player)) {
        return;
    }

    Inventory inventory = InventoryManager.get(player).getInventory();
    Slot petSlot = getMyPetSlot();
    ItemStack currentPetItem = inventory.getItem(petSlot.getSlotId());

    if (isMyPetItem(currentPetItem)) {
        UUID petUUID = UUID.fromString(ItemUtils.getTag(currentPetItem, MYPET_TAG));
        if (petUUID.equals(event.getMyPet().getUUID())) {
            inventory.setItem(petSlot.getSlotId(), petSlot.getCup());
        }
    }
}
 
开发者ID:EndlessCodeGroup,项目名称:RPGInventory,代码行数:19,代码来源:MyPetManager.java

示例5: event

import java.util.UUID; //导入方法依赖的package包/类
@Override
public void event(MT type, Object o)
{
	switch (type)
	{
		case CHALLENGE_CHANGED:
		case ENTRANT_CHANGED:
			UUID challengeid = ChallengeGUI.state.getCurrentChallengeId();
			Collection<UUID> exclude;
			Collection<Entrant> reg;
			if (!challengeid.equals(IdGenerator.nullid))
			{
				reg = Database.d.getEntrantsByEvent(ChallengeGUI.state.getCurrentEventId());
				exclude = Database.d.getCarIdsByChallenge(challengeid);
			}
			else
			{
				reg = new Vector<Entrant>();
				exclude = new Vector<UUID>();
			}

			makeTree(reg, exclude);
			break;
	}
}
 
开发者ID:drytoastman,项目名称:scorekeeperfrontend,代码行数:26,代码来源:EntrantTree.java

示例6: onMyPetCall

import java.util.UUID; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void onMyPetCall(MyPetCallEvent event) {
    Player player = event.getOwner().getPlayer();
    if (!InventoryManager.playerIsLoaded(player)) {
        return;
    }

    Inventory inventory = InventoryManager.get(player).getInventory();
    ItemStack currentPet = inventory.getItem(getMyPetSlot().getSlotId());
    boolean keepPet = true;

    if (!isMyPetItem(currentPet)) {
        keepPet = false;
    } else {
        UUID petUUID = UUID.fromString(ItemUtils.getTag(currentPet, MYPET_TAG));
        if (!petUUID.equals(event.getMyPet().getUUID())) {
            keepPet = false;
        }
    }

    if (!keepPet) {
        event.setCancelled(true);
        MyPetApi.getMyPetManager().deactivateMyPet(event.getOwner(), true);
    }
}
 
开发者ID:EndlessCodeGroup,项目名称:RPGInventory,代码行数:26,代码来源:MyPetManager.java

示例7: showTitle

import java.util.UUID; //导入方法依赖的package包/类
private void showTitle(Player player, Chunk newChunk) {
	UUID newOwner = ClaimChunk.getInstance().getChunkHandler().getOwner(newChunk.getWorld(), newChunk.getX(), newChunk.getZ());
	if (!newOwner.equals(player.getUniqueId())) {
		PlayerHandler nh = ClaimChunk.getInstance().getPlayerHandler();
		String newName = (nh.hasChunkName(newOwner)) ? nh.getChunkName(newOwner) : nh.getUsername(newOwner);
		if (newName != null) {
			String text = Utils.getMsg("chunkOwner").replaceAll(Pattern.quote("%%PLAYER%%"), newName);
			Utils.toPlayer(player, Config.getColor("infoColor"), text);
		}
	} else {
		Utils.toPlayer(player, Config.getColor("infoColor"), Utils.getMsg("chunkSelf"));
	}
}
 
开发者ID:cjburkey01,项目名称:ClaimChunk,代码行数:14,代码来源:PlayerMovementHandler.java

示例8: serialOf

import java.util.UUID; //导入方法依赖的package包/类
@Override
public OptionalLong serialOf(UUID l) {
    // hilariously inefficient
    for (Map.Entry<Long, Fact> e : store.entrySet()) {
        if (l.equals(e.getValue().id())) {
            return OptionalLong.of(e.getKey().longValue());
        }
    }
    return OptionalLong.empty();
}
 
开发者ID:uweschaefer,项目名称:factcast,代码行数:11,代码来源:InMemFactStore.java

示例9: pickupItemEvent

import java.util.UUID; //导入方法依赖的package包/类
@EventHandler
public void pickupItemEvent(PlayerPickupItemEvent event) {
    UUID iuuid = event.getItem().getUniqueId();
    if (itemMapTime.containsKey(iuuid)) {
        if (System.currentTimeMillis() - itemMapTime.get(iuuid) < 10000) {
            UUID owneruuid = itemMapOwner.get(iuuid);
            Player owner = plugin.getServer().getPlayer(owneruuid);
            PlayerDataRPG pdo = plugin.getPD(owner);
            PlayerDataRPG pd = plugin.getPD(event.getPlayer());
            if (owneruuid == null || owneruuid.equals(event.getPlayer().getUniqueId()) || (pdo != null && pd != null && pd.party != null && pd.party != pdo.party && pd.party.isLootshareActive())) {
                itemMapTime.remove(iuuid);
                itemMapOwner.remove(iuuid);
                return; // all good
            } else {
                event.setCancelled(true);
                if (plugin.getPD(event.getPlayer()) != null && plugin.getPD(event.getPlayer()).getOption(SakiOption.ITEM_PROTECT)) {
                    if (playerMapMessaged.containsKey(event.getPlayer().getUniqueId()) && System.currentTimeMillis() - playerMapMessaged.get(event.getPlayer().getUniqueId()) < 5000) {
                        // dont spam msg
                    } else {
                        event.getPlayer().sendMessage(ChatColor.RED + " You can't pick up this item yet because of item protection!");
                        event.getPlayer().sendMessage(ChatColor.RED + " Monster drops are only lootable by the highest damage dealer for 10 seconds.");
                        event.getPlayer().sendMessage(ChatColor.RED + " Skill-related items are only lootable by the creator of the item for 10 seconds.");
                        playerMapMessaged.put(event.getPlayer().getUniqueId(), System.currentTimeMillis());
                    }
                }
            }
        } else {
            itemMapTime.remove(iuuid);
            itemMapOwner.remove(iuuid);
        }
    }
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:33,代码来源:DropManager.java

示例10: getById

import java.util.UUID; //导入方法依赖的package包/类
@Override
public NemesisEntry getById(UUID id) {
	if (id == null) {
		return null;
	}
	for (NemesisEntry nemesis : nemeses) {
		if (id.equals(nemesis.getId())) {
			return nemesis;
		}
	}
	return null;
}
 
开发者ID:ToroCraft,项目名称:NemesisSystem,代码行数:13,代码来源:NemesisRegistry.java

示例11: knowsCharacteristic

import java.util.UUID; //导入方法依赖的package包/类
@Override
public boolean knowsCharacteristic(BluetoothGattCharacteristic characteristic) {
	for (UUID uuid : getKnownCharacteristics()) {
		if (uuid.equals(characteristic.getUuid()))
			return true;
	}
	return false;
}
 
开发者ID:masterjc,项目名称:bluewatcher,代码行数:9,代码来源:WatchCtrlService.java

示例12: findWritableCharacteristic

import java.util.UUID; //导入方法依赖的package包/类
private BluetoothGattCharacteristic findWritableCharacteristic(BluetoothGattService service, UUID characteristicUUID, int writeType) {
	try {
		BluetoothGattCharacteristic characteristic = null;

		// get write property
		int writeProperty = BluetoothGattCharacteristic.PROPERTY_WRITE;
		if (writeType == BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE) {
			writeProperty = BluetoothGattCharacteristic.PROPERTY_WRITE_NO_RESPONSE;
		}

		List<BluetoothGattCharacteristic> characteristics = service.getCharacteristics();
		for (BluetoothGattCharacteristic c : characteristics) {
			if ((c.getProperties() & writeProperty) != 0 && characteristicUUID.equals(c.getUuid())) {
				characteristic = c;
				break;
			}
		}

		// As a last resort, try and find ANY characteristic with this UUID, even if it doesn't have the correct properties
		if (characteristic == null) {
			characteristic = service.getCharacteristic(characteristicUUID);
		}

		return characteristic;
	}catch (Exception e) {
		Log.e(LOG_TAG, "Error on findWritableCharacteristic", e);
		return null;
	}
}
 
开发者ID:lenglengiOS,项目名称:react-native-blue-manager,代码行数:30,代码来源:Peripheral.java

示例13: setOwner

import java.util.UUID; //导入方法依赖的package包/类
public boolean setOwner(UUID owner) {
	
	if ((this.owner != null && !this.owner.equals(owner)) || (owner != null && !owner.equals(this.owner))) {
		
		this.owner = owner;
		if (worldObj != null && !worldObj.isRemote)
			markDirty();
	}
	return true;
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:11,代码来源:TileFeroxia.java

示例14: parseSchemeSpecificData

import java.util.UUID; //导入方法依赖的package包/类
/**
 * Parses the scheme specific data from a PSSH atom. Version 0 and 1 PSSH atoms are supported.
 * <p>
 * The scheme specific data is only parsed if the data is a valid PSSH atom matching the given
 * UUID, or if the data is a valid PSSH atom of any type in the case that the passed UUID is null.
 *
 * @param atom The atom to parse.
 * @param uuid The required UUID of the PSSH atom, or null to accept any UUID.
 * @return The parsed scheme specific data. Null if the input is not a valid PSSH atom, or if the
 *     PSSH atom has an unsupported version, or if the PSSH atom does not match the passed UUID.
 */
public static byte[] parseSchemeSpecificData(byte[] atom, UUID uuid) {
  Pair<UUID, byte[]> parsedAtom = parsePsshAtom(atom);
  if (parsedAtom == null) {
    return null;
  }
  if (uuid != null && !uuid.equals(parsedAtom.first)) {
    Log.w(TAG, "UUID mismatch. Expected: " + uuid + ", got: " + parsedAtom.first + ".");
    return null;
  }
  return parsedAtom.second;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:23,代码来源:PsshAtomUtil.java

示例15: getNonPrivilegedMembers

import java.util.UUID; //导入方法依赖的package包/类
/**
 * @return
 * a Set of all members that are not mod or admin as OfflinePlayers
 */
public Collection<OfflinePlayer> getNonPrivilegedMembers() {
    HashSet<OfflinePlayer> players = new HashSet<>();
    for (UUID member : members.getUniqueIds()) {
        if (!mods.contains(member) && !member.equals(admin)) {
            players.add(Bukkit.getOfflinePlayer(member));
        }
    }
    return players;
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:14,代码来源:Faction.java


注:本文中的java.util.UUID.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。