@Test public void parsesString() { EntityTag entityTag = entityTagHeaderDelegate.fromString("\"test\""); assertFalse(entityTag.isWeak()); assertEquals("test", entityTag.getValue()); }
@Override public EntityTag fromString(String header) { if (header == null) { throw new IllegalArgumentException(); } boolean isWeak = header.startsWith("W/"); String value; if (isWeak) { value = cutWeakPrefix(header); } else { value = header; } value = value.substring(1, value.length() - 1); value = HeaderHelper.removeQuoteEscapes(value); return new EntityTag(value, isWeak); }
EntityTagHeaderDelegate implements RuntimeDelegate.HeaderDelegate<EntityTag> { @Override public EntityTag fromString(String header) { if (header == null) { throw new IllegalArgumentException(); } boolean isWeak = header.startsWith("W/"); String value; if (isWeak) { value = cutWeakPrefix(header); } else { value = header; } value = value.substring(1, value.length() - 1); value = HeaderHelper.removeQuoteEscapes(value); return new EntityTag(value, isWeak); } }
EntityTagHeaderDelegate implements RuntimeDelegate.HeaderDelegate<EntityTag> { @Override public EntityTag fromString(String header) { if (header == null) { throw new IllegalArgumentException(); } boolean isWeak = header.startsWith("W/"); String value; if (isWeak) { value = cutWeakPrefix(header); } else { value = header; } value = value.substring(1, value.length() - 1); value = HeaderHelper.removeQuoteEscapes(value); return new EntityTag(value, isWeak); }  }
EntityTagHeaderDelegate implements RuntimeDelegate.HeaderDelegate<EntityTag> { @Override public EntityTag fromString(String header) { if (header == null) { throw new IllegalArgumentException(); } boolean isWeak = header.startsWith("W/"); String value; if (isWeak) { value = cutWeakPrefix(header); } else { value = header; } value = value.substring(1, value.length() - 1); value = HeaderHelper.removeQuoteEscapes(value); return new EntityTag(value, isWeak); }  @Override EntityTag fromString(String header); @Override String toString(EntityTag entityTag); }
EntityTagHeaderDelegate implements RuntimeDelegate.HeaderDelegate<EntityTag> { @Override public EntityTag fromString(String header) { if (header == null) { throw new IllegalArgumentException(); } boolean isWeak = header.startsWith("W/"); String value; if (isWeak) { value = cutWeakPrefix(header); } else { value = header; } value = value.substring(1, value.length() - 1); value = HeaderHelper.removeQuoteEscapes(value); return new EntityTag(value, isWeak); }  @Override EntityTag fromString(String header); @Override String toString(EntityTag entityTag);  }