當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。