List of usage examples for java.util UUID fromString
public static UUID fromString(String name)
From source file:org.unidle.repository.AuditorAwareImpl.java
@Override public User getCurrentAuditor() { final Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication == null) { return null; }/* w ww . ja va 2s . c om*/ final String uuid = authentication.getName(); return "".equals(uuid) ? null : userRepository.findOne(UUID.fromString(uuid)); }
From source file:com.foundationdb.server.types.aksql.aktypes.AkGUIDTest.java
@Test public void checkUUIDToBytes() { String uuidString = "384000008cf011bdb23e10b96e4ef00d"; UUID uuid = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d"); byte[] bytes = AkGUID.uuidToBytes(uuid); String output = Hex.encodeHexString(bytes); assertEquals(output, uuidString);//from www . ja v a 2 s .c o m }
From source file:com.consol.citrus.samples.todolist.web.TodoController.java
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, headers = "content-type=application/x-www-form-urlencoded") @ResponseBody//from w w w. j a v a2 s . c o m public ResponseEntity setEntryStatus(@PathVariable(value = "id") String id, @RequestParam(value = "done") boolean done) { todoListService.setStatus(UUID.fromString(id), done); return ResponseEntity.ok().build(); }
From source file:fm.last.musicbrainz.data.dao.impl.ArtistDaoImplIT.java
@Test public void getByExistingGidReturnsOneArtist() { UUID gid = UUID.fromString("994fcd41-2831-4318-9825-66bacbcf2cfe"); Artist artist = dao.getByGid(gid);//from w w w . ja v a 2 s. c om assertThat(artist.getName(), is("Q and Not U")); }
From source file:org.killbill.billing.plugin.forte.api.FortePaymentTransactionInfoPlugin.java
public FortePaymentTransactionInfoPlugin(final ForteResponsesRecord record) { super(UUID.fromString(record.getKbPaymentId()), UUID.fromString(record.getKbPaymentTransactionId()), TransactionType.valueOf(record.getTransactionType()), record.getAmount(), record.getCurrency() == null ? null : Currency.valueOf(record.getCurrency()), getPluginStatus(record.getPgResponseType()), record.getPgResponseDescription(), record.getPgResponseCode(), record.getPgTraceNumber(), record.getPgAuthorizationCode(), new DateTime(record.getCreatedDate(), DateTimeZone.UTC), new DateTime(record.getCreatedDate(), DateTimeZone.UTC), ForteDao.buildPluginProperties(record.getAdditionalData())); }
From source file:com.spectralogic.ds3cli.command.PutJob.java
@Override public CliCommand init(final Arguments args) throws Exception { processCommandOptions(requiredArgs, optionalArgs, args); this.jobId = UUID.fromString(args.getId()); this.priority = args.getPriority(); return this; }
From source file:com.spectralogic.ds3cli.command.GetJob.java
@Override public CliCommand init(final Arguments args) throws Exception { processCommandOptions(requiredArgs, EMPTY_LIST, args); this.jobId = UUID.fromString(args.getId()); return this; }
From source file:com.spectralogic.ds3cli.command.DeleteJob.java
@Override public CliCommand init(final Arguments args) throws Exception { processCommandOptions(requiredArgs, optionalArgs, args); this.id = UUID.fromString(args.getId()); this.force = args.isForce(); return this; }
From source file:fm.last.musicbrainz.data.dao.impl.RecordingDaoIT.java
@Test public void getByExistingGidReturnsOneRecording() { UUID gid = UUID.fromString("4ea1383f-aca7-4a39-9839-576cf3af438b"); Recording recording = dao.getByGid(gid); assertThat(recording.getName(), is("The Saint")); }
From source file:org.efaps.rest.AbstractRest.java
/** * Check if the logged in users has access to rest. * User must be assigned to the Role "Admin_Rest". * * @return true if user is assigned to Roles "Admin_Rest", else false * @throws EFapsException on error/* w ww. j a va 2 s. com*/ */ protected boolean hasAccess() throws EFapsException { //Admin_REST return Context.getThreadContext().getPerson() .isAssigned(Role.get(UUID.fromString("2d142645-140d-46ad-af67-835161a8d732"))); }