Skip to main content

Check isEmpty() in Java

Instead of isNullOrEmpty()
public static boolean isNullOrEmpty(String contentType) {
if (contentType != null && !contentType.isEmpty())
return false;
return true;
}

use StringUtils.isEmpty();

Comments

Post a Comment

Popular posts from this blog

Awkwardness

I am so scared to talk To ask , to react , to wait , to listen , to understand the simple things  that people easily converse about. Its not like I do not like to listen ,   Its not like I do not like to share ,  Its not like I do not like to question , Its the way I have been known, addressed continually I am expecting a lot more from my people that they should ask,  I would calmly listen, They should guess and  I would respond  There. is a gap of my initiative to respond to surroundings I love being in my own world until someone makes me realise I am doing something out of the world  Thats not the way to do. Thats not the time to be quiet. Thats such a simple thing to understand . But you know what you do not want to change . You have ego bigger than to converse right thing right at the face. You have an image of being good. You act as if they are going to give you an award. It is not the way to be. You behave fake . Why...

Me to Me

You make me happy You fill my world You are the hope for which I just more and more... You changed my thoughts... You changed it life You do.. Observe me You are my inspiration You have a special way...of making me feel more precious n valuable.. Than I believe I am.. Your soft gentle smile... Ohh... Speaks to my heart... As if you truly understand me... When something is on my mind or heavies my heart.. You always seems to know what I want to say...before I even start... When I just need a walk u walk along with me.. When I just need to talk.. Just to sort through my emotions or just clarify my thoughts.. You listen with ease and devotion and I no longer feel distraughted... I m lucky to have you in my life... Bcoz you are me.. You don't have life though you understand me so so well... When I dance u dance... When I think you think.. When I cry u cry with me.. When I laugh u laugh with me... And many more.... That do not end..... Yet.... Its the anothe...

What should one not do in life!!

Being too nice.  That's when others take you for granted most of the times. Holding on to crude past that pricks you every time when you think about it. Never waste your time on silly things. Don't fall in love with someone who is already in love with another person. Do not ignore your health. Don't be sloppy. Regretting.  Mistakes are bound to happen, sometimes. Procrastination.  Do it now right now if you want it. Don't hesitate to know people. Read them. Everyone has their own story. Putting your key to happiness in someone's hands. Expectations.  Expecting more from others and yourself is just simply going to increase the number of sleepless nights. Don't stop loving or spending time with your parents. Falling in love when you're lonely but fall in love only when you're ready. These are some few things that I agree upon;)